private void LoadShowHistory(ShowDetail shw) { txtshowname.Text = shw.Show; txtshowbegindate.Text = shw.ShowBegindate; txtoverheadnut.Text = shw.OverheadNut; txtvariableroyalities.Text = shw.VariableRoylaties; txtwklyopexp.Text = shw.WeeklyOperatingExpense; txtcorpname.Text = shw.CorporateName; string[] CM = shw.CompanyManager.Split(','); for (int i = 0; i < CM.Count(); i++) { foreach (ListItem item in ddckComanyManager.Items) { if (CM[i] == item.Text) item.Selected = true; } } }
public void SearchShowHistoryUpdate(string userid, ShowDetail shw) { SqlCommand cmd = new SqlCommand("spInsertUpdateShowHistory", dbconn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@UserID", userid); cmd.Parameters.AddWithValue("@CompanyM", shw.CompanyManager); cmd.Parameters.AddWithValue("@CorporateN", shw.CorporateName); cmd.Parameters.AddWithValue("@Show", shw.Show); cmd.Parameters.AddWithValue("@Showbegindate", shw.ShowBegindate); cmd.Parameters.AddWithValue("@VariableR", shw.VariableRoylaties); cmd.Parameters.AddWithValue("@WOE", shw.WeeklyOperatingExpense); cmd.Parameters.AddWithValue("@OverheadN", shw.OverheadNut); try { if (dbconn.State == ConnectionState.Closed) { dbconn.Open(); } cmd.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } } }
private void InsertShowHistory() { string companyManager = ""; ShowDetail shw = new ShowDetail(); foreach (System.Web.UI.WebControls.ListItem item in ddckComanyManager.Items) { if (item.Selected) { if (companyManager != "") { companyManager = "," + item.Text; } else { companyManager = item.Text; } } } shw.Show = txtshowname.Text.Trim().ToString(); shw.ShowBegindate = txtshowbegindate.Text.Trim().ToString(); shw.VariableRoylaties = txtvariableroyalities.Text.Trim().ToString(); shw.WeeklyOperatingExpense = txtwklyopexp.Text.Trim().ToString(); shw.CompanyManager = companyManager; shw.CorporateName = txtcorpname.Text.Trim().ToString(); objmsd.SearchShowHistoryUpdate(userid, shw); }
public ShowDetail GetSearchShowHistory(int mode, string userid) { DataTable dt = new DataTable(); ShowDetail shw = null; SqlCommand cmd = new SqlCommand("spGetHistoryAll", dbconn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Mode", mode); cmd.Parameters.AddWithValue("@UserID", userid); cmd.CommandType = CommandType.StoredProcedure; try { if (dbconn.State == ConnectionState.Closed) { dbconn.Open(); } SqlDataReader dr = cmd.ExecuteReader(); dt.Load(dr); if (dt != null) { if (dt.Rows.Count > 0) { shw = new ShowDetail(); shw.CompanyManager = Convert.ToString(dt.Rows[0][3]); shw.CorporateName = Convert.ToString(dt.Rows[0][2]); shw.OverheadNut = Convert.ToString(dt.Rows[0][4]); shw.Show = Convert.ToString(dt.Rows[0][0]); shw.ShowBegindate = Convert.ToString(dt.Rows[0][1]); shw.VariableRoylaties = Convert.ToString(dt.Rows[0][5]); shw.WeeklyOperatingExpense = Convert.ToString(dt.Rows[0][6]); return shw; } } return shw; } catch (Exception ex) { throw ex; } finally { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } } }