|
I work with this method
PL-->Business objects--->BLL---->DAL
|
|
|
|
|
Ok now Remove all the references to the Projects.
let us start from the Back the DAL.
DAL The DAL must not reference any Project, if you have a reference to any project then remove it
BLL Add a Reference of DAL in the this Project(Only the Reference to DAL must exists)
Business objects Add the Reference to BLL(Only the Reference to BLL must Exists)
PL Add a Reference to the Business objects(Only the Reference to the Business objects must exist)
Note: if you want to add a Reference Right Click the Individual not a Solution but a Class Library and select the "Add References" option and a dialogbox will appear, Click on the "Project Tab" and select the appropriate project.
Hope you understand this
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
yes I understand , and thank you for your help Vuyiswa Maseko
|
|
|
|
|
You welcome
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I'm going to bother you again Vuyiswa Maseko, I would take your advice on my way to work, so I'll create a function to insert data into the dbb without using the property of class (get, set),and in the bll level I appeal to dal and business object class ,and in level presentation I'll call bll .
is correct????
|
|
|
|
|
Yes that is Correct
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
but my problem is how to call the properties of the class busniss object (get, set) in reference bll without make a reference ???
|
|
|
|
|
if i remember correctly you have chosen this approach
PL-->Business objects--->BLL---->DAL
You want to access the Properties of the Business objects in a BLL. This is not Good. The Tiers were made to encapsulate the what is happening in other Tiers. But now if you want the BLL to access the Business objects layer then its no longer called an N-Tier architecture. the logic here is to make sure the DAL has no knowledge that there is BLL and BLL has no knowledge that there is Business objects and Business objects has no Knowledge of the PL not the way around. That is why in the DAL you must make all functions that needs to be accessed in the BLL as public and same in the BLL you must make all functions that needs to be access in the Business objects and same to the Business objects you must make the functions public that needs to be accessed in the PL.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
yes you are right, but if I create a class object that contains property (get and set) to have access to property through this class, if I was wrong, so why create a class object containing the property get , set ?????
|
|
|
|
|
Maybe i misunderstood you
You want to access properties of a Class , that have been declare Public in the Class?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Yes I want to access to Properties declared public in class busniss object in the class bll
|
|
|
|
|
To then its simple
create an object of a business object class
BOClass obj new BPClass();
obj.PropertySet= "3" --Property set ,set the value of a property
String GetValue = obj.PropertyGet();--Get the value of a property
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hello
What is the maximum size for webconfig not to have any problem? Forexample if the webconfig file is bigger than 5 MB or bigger than 50000 lines, that can couse a problem.
Would it make my site work slower ?
viva la commune
|
|
|
|
|
The web config file is loaded when the application goes online. It is loaded only once and is shared between all users. So as long as you have a decent hardware configuration for your server, you shouldn't have any problems, it should work.
On the flip side having a large number of config entries can increase the seek time when accessing config items.
HTH!
|
|
|
|
|
Hi friends,
I hav got a problem while redirecting my web interface to other remote web interface.
Here the scenario is, i hav integrated my web interface with other remote web interface,
A link on remote web interface will route to my web interface with user credentials, after validation
browses through my web.
I am using response.redirect to redirect to pages. this is working fine in Firefox and chrome but does not work in IE, m getting session expire problem in IE.
pls suggest , thanks in advance.
Regards
Surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
I sorted it out myself after googling for sometime.
By adding HTTPHEADER P3P:CP="CAO PSA OUR" In IIS resolved my problem.
Hope this would help others.
Regards
Surender
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
iam taking data from one page gridview to another page in session but it is not displaying in another page gridview
please check my code and give suggestion which helps me
string constr = "Data Source=MAINSERVER;Initial Catalog=Inventory;User ID=sa;Password=nsg_ss_0103";<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
<br />
if (Page.IsPostBack == false)<br />
{<br />
GridView1.PageIndex = 0;<br />
<br />
bindata();<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
<br />
}<br />
private void bindata()<br />
{<br />
<br />
SqlConnection con12 = new SqlConnection(constr);<br />
SqlDataAdapter da12 = new SqlDataAdapter("SELECT [CategoryNameE], [ItemKey], [ItemKeyNameE], [CurrentQTY], [SalesPrice] FROM [CurrentInWH]", con12);<br />
DataSet ds = new DataSet();<br />
da12.Fill(ds, "t");<br />
GridView1.DataSource = ds.Tables["t"];<br />
GridView1.DataBind();<br />
}<br />
<br />
private void GetGridViewData()<br />
{<br />
DataTable dt;<br />
if(Session["CheckedRecords"]!=null)<br />
dt = (DataTable)Session["CheckedRecords"];<br />
else<br />
dt = CreateNewTable();<br />
<br />
for (int i = 0; i < GridView1.Rows.Count; i++)<br />
{<br />
CheckBox chk = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("chk");<br />
if (chk.Checked)<br />
{<br />
dt = AddNewRow(GridView1.Rows[i], dt);<br />
}<br />
else<br />
{<br />
dt = RemoveRow(GridView1.Rows[i], dt);<br />
}<br />
<br />
}<br />
Session["CheckedRecords"] = dt;<br />
<br />
}<br />
<br />
private DataTable CreateNewTable()<br />
{<br />
DataTable dt = new DataTable();<br />
dt.Columns.Add("CategoryNameE");<br />
dt.Columns.Add("ItemKey");<br />
dt.Columns.Add("ItemKeyNameE");<br />
dt.Columns.Add("CurrentQTY");<br />
dt.Columns.Add("SalesPrice");<br />
dt.Columns.Add("Quantity");<br />
dt.Columns.Add("Total");<br />
<br />
dt.AcceptChanges();<br />
return dt;<br />
}<br />
<br />
private DataTable AddNewRow(GridViewRow gvrow, DataTable dt)<br />
{<br />
DataRow[] dr = dt.Select("ItemKey = '" + gvrow.Cells[2].Text + "'");<br />
if (dr.Length <= 0)<br />
{<br />
dt.Rows.Add();<br />
dt.Rows[dt.Rows.Count - 1]["CategoryNameE"] = gvrow.Cells[1].Text;<br />
dt.Rows[dt.Rows.Count - 1]["ItemKey"] = gvrow.Cells[2].Text;<br />
dt.Rows[dt.Rows.Count - 1]["ItemKeyNameE"] = gvrow.Cells[3].Text;<br />
dt.Rows[dt.Rows.Count - 1]["CurrentQTY"] = gvrow.Cells[4].Text;<br />
dt.Rows[dt.Rows.Count - 1]["SalesPrice"] = gvrow.Cells[5].Text;<br />
dt.Rows[dt.Rows.Count - 1]["Quantity"] = gvrow.Cells[6].Text;<br />
dt.Rows[dt.Rows.Count - 1]["Total"] = gvrow.Cells[7].Text;<br />
<br />
<br />
<br />
dt.AcceptChanges();<br />
}<br />
return dt;<br />
}<br />
<br />
private DataTable RemoveRow(GridViewRow gvrow, DataTable dt)<br />
{<br />
DataRow[] dr = dt.Select("ItemKey= '" + gvrow.Cells[2].Text + "'");<br />
if (dr.Length > 0)<br />
{<br />
dt.Rows.Remove(dr[0]);<br />
dt.AcceptChanges();<br />
}<br />
return dt;<br />
}<br />
<br />
protected void chk_CheckedChanged(object sender, EventArgs e)<br />
{<br />
GetGridViewData();<br />
<br />
<br />
<br />
TextBox txtqty1; TextBox txttott; CheckBox ch = null;<br />
for (int i = 0; i < GridView1.Rows.Count; i++)<br />
{<br />
<br />
txtqty1 = (TextBox)GridView1.Rows[i].FindControl("txtqty");<br />
txttott = (TextBox)GridView1.Rows[i].FindControl("txttot");<br />
ch = (CheckBox)GridView1.Rows[i].FindControl("chk");<br />
<br />
if (ch.Checked)<br />
{<br />
txtqty1.Visible = true;<br />
txttott.Visible = true;<br />
}<br />
else<br />
{<br />
<br />
txtqty1.Visible = false;<br />
txttott.Visible = false;<br />
<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
<br />
}<br />
DataTable dt = (DataTable)Session["CheckedRecords"];<br />
GridView1.DataSource = dt;<br />
GridView1.DataBind();<br />
<br />
|
|
|
|
|
First and foremost, edit your post and remove the connection details. Its not so good to post your SQL server's sa password on forums even if it is CodeProject.
First step to solving this would be to step through your code and identify if the dt that your are persisting in the session has any values. Debug the application, put a break point on the statement Session["CheckedRecords"] = dt; . Check if it has any values before going into the session.
If it has values then on the 2nd page check what you are getting out of the session. Again put a break point on the line DataTable dt = (DataTable)Session["CheckedRecords"]; and check the values in dt.
Some suggestions [read free advice ]
1. Data table is an reference type. You need not return it from AddNewRow and RemoveRow methods. The dt in the calling function and the dt local to AddNewRow and RemoveRow methods point to the same datatable in the heap. Doing this way would just increase the over head on the GC and reduce maintainability of your code.
2. In the AddNewRow method, rather than doing "dt.Rows.Count - 1 " every time, do it once and store it as rowNum and use it subsequently. This reduces the number of execution cycles.
3. Format your code. Proper indentation improves readability.
HTH!
|
|
|
|
|
check the reply for your post on:
http://opexsolution.com/forum/viewtopic.php?f=15&t=27
|
|
|
|
|
Hi Guys
Is it possible to format specific words using CSS?
I'm wanting to highlight key words within some pages of code samples, but don't fancy wrapping all the keywords in tags...
Cheers,
oooo, the Jedi's will feel this one....
|
|
|
|
|
The current level of CSS does not offer this much
desired feature.It can be acomplished with a simple
regular expression either in javascript on the client
or the language of your choice on the server.The
result would be to progromaticaly add fancy wrapping
in tags to all the keywords .
|
|
|
|
|
OK cool. I'll have a crack at that method then. A little c# behind the scenes could go a long way...
Thank you.
oooo, the Jedi's will feel this one....
|
|
|
|
|
hello,
I want to make invitation facility in my website.j
so please...
can anyone tell me how to import contacts from gmail, yahoo, etc in asp.net.
it's very urgent.
Thanks in advance.
|
|
|
|
|
|
Each of them have their own services to import contacts,please see on google.com
|
|
|
|