I did this code in my presentation layer but I do not know how to do this at level 3. . Please help, I am stacked with this problem Form1_Load () {cboStatus (); GetlistView (); }
field "fill combo"
public zero cboStatus (try {SqlConnection conn = new SqlConnection (connStr); SqlCommand sqlcom = New SqlCommand ("sp_loadStatus", conn); Sqlcom.CommandType = CommandType.StoredProcedure; SqlDataReader dr = faucet; Conn.Open (); Dr = sqlcom.ExecuteReader (); CmbStatus.Items.Clear (); While (Dr. Reid ()) {cmbStatus.Items.Add (([[[StatusDescription "]"); } If (conn.State == ConnectionState.Open) conn.Close (); } Hold (Exception pre) {Message Box. Show ("Error:" + east); } Finally {}} #rdrijan #region "Field List View" Public Zero GetlistView () {int i = 0; SqlConnection sqlcon = New SqlConnection (connStr); LstBF.Items.Clear (); SqlCommand sqlcom = New SqlCommand ("sp_LoadNew", sqlcon); Sqlcom.CommandType = CommandType.StoredProcedure; SqlDataReader dr; LstBF.Items.Clear (); Sqlcon.Open (); Dr = sqlcom.ExecuteReader (); While (Dr. Reid ()) {lstBF.Items.Add (dr ["SerialNumber"]. ToString ()); LstBF.Items [i] .SubItems.Add (Dr. ["PARTNUMBER"] ToString ().); LstBF.Items [i] .SubItems.Add (Dr. ["StatusDescription"] ToString ().); LstBF.Items [i] .SubItems.Add (Dr. ["CUSTOMERNAME"] ToString ().); LstBF.Items [i] .SubItems.Add (.dw ["DateCreated"] ToString ()); LstBF.Items [i] .SubItems.Add (Dr. ["CreatedBy"] ToString ().); LstBF.Items [i] .SubItems.Add (.dro ["ModifiedBy"] ToString ()); I = i + 1; } If (sqlcon.State == ConnectionState.Open) sqlcon.Close (); } #endrian
There are probably some things you can do, but I think The most basic business objectives (C # class) that represent the position and what you are displaying in your listview (probably in some type of product)
Your data level must contain data access codes (SqlConnection and such) that create a collection of positions and products.
Your business tire will take care of any business logic (which is not very much to you, which is fine).
Your presentation category will tie UI controls back to the data tier (via business category).
In fact, your business objectives are business tire units.
From there, you may be in line with Data Access Classes, your business items and the like.
Here's a good technical article to get you started:
Comments
Post a Comment