/// <summary> /// Set Grid Data source /// </summary> /// <param name="addRow"></param> /// <param name="deleteRow"></param>e private void BindGrid() { NegoBLL NegoBLLobj = new NegoBLL(); grdScheduled.DataSource = NegoBLLobj.GetNGODATA(Convert.ToInt32(ViewState["CULTURALPROPID"])); grdScheduled.DataBind(); }
/// <summary> /// To get the data /// </summary> private void GetData() { NegoBLL BLLobj = new NegoBLL(); int CULTURALNEGOID = 0; if (ViewState["CULTURALNEGOID"] != null) { CULTURALNEGOID = Convert.ToInt32(ViewState["CULTURALNEGOID"]); } Nego BOobj = new Nego(); BOobj = BLLobj.GetData(CULTURALNEGOID); CULTURALNEGOIDtxtbx.Text = BOobj.CULTURALNEGOID.ToString(); AppntDate.Text = Convert.ToString(BOobj.NEGO_APPOINTMENTDATE.ToString(UtilBO.DateFormat)); txtbxVenueforNegotiation.Text = BOobj.NEGO_VENUE; NegotDate.Text = Convert.ToString(BOobj.NEGO_DATE.ToString(UtilBO.DateFormat)); txtbxProblems.Text = BOobj.NEGO_PROBLEMDESC; }
/// <summary> ///To save the scheduled information /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ScheduledInformBtnSave_Click(object sender, EventArgs e) { int count = 0; if (CULTURALNEGOIDtxtbx.Text == string.Empty) { NegoBLL BLLobj = new NegoBLL(); try { string uID = Session["USER_ID"].ToString(); string hhid = Session["HH_ID"].ToString(); int CULTURALPROPID = Convert.ToInt32(ViewState["CULTURALPROPID"]); Nego Negoobj = new Nego(); Negoobj.HHID = Convert.ToInt32(hhid); Negoobj.CULTURALPROPID = CULTURALPROPID; Negoobj.NEGO_APPOINTMENTDATE = Convert.ToDateTime(AppntDate.Text); Negoobj.NEGO_VENUE = txtbxVenueforNegotiation.Text; Negoobj.NEGO_DATE = Convert.ToDateTime(NegotDate.Text); if (txtbxProblems.Text != string.Empty) { Negoobj.NEGO_PROBLEMDESC = txtbxProblems.Text; } else { Negoobj.NEGO_PROBLEMDESC = ""; } Negoobj.ISDELETED = "False"; Negoobj.CREATEDBY = Convert.ToInt32(uID); NegoBLL NegoBLLobj = new NegoBLL(); count = NegoBLLobj.Insert(Negoobj); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Data saved successfully');", true); ClearScheduledData(); BindGrid(); } catch (Exception ex) { throw ex; } finally { BLLobj = null; } } else if (CULTURALNEGOIDtxtbx.Text != string.Empty) { NegoBLL BLLobj = new NegoBLL(); try { string uID = Session["USER_ID"].ToString(); string hhid = Session["HH_ID"].ToString(); int CULTURALPROPID = Convert.ToInt32(ViewState["CULTURALPROPID"]); Nego Negoobj = new Nego(); Negoobj.HHID = Convert.ToInt32(hhid); Negoobj.CULTURALNEGOID = Convert.ToInt32(CULTURALNEGOIDtxtbx.Text); Negoobj.CULTURALPROPID = CULTURALPROPID; Negoobj.NEGO_APPOINTMENTDATE = Convert.ToDateTime(AppntDate.Text); Negoobj.NEGO_VENUE = txtbxVenueforNegotiation.Text; Negoobj.NEGO_DATE = Convert.ToDateTime(NegotDate.Text); Negoobj.NEGO_PROBLEMDESC = txtbxProblems.Text; Negoobj.ISDELETED = "False"; Negoobj.CREATEDBY = Convert.ToInt32(uID); NegoBLL NegoBLLobj = new NegoBLL(); count = NegoBLLobj.Update(Negoobj); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Updated", "ShowUpdateMessage('');", true); ClearScheduledData(); BindGrid(); SetUpdateMode(false); } catch (Exception ex) { throw ex; } finally { BLLobj = null; } } }