protected void btnSave_OnClick(object sender, EventArgs e) { PrescriptionSessionData prscSessionData = new PrescriptionSessionData(); prscSessionData.SessionDataName = txtData.Text; PrescriptionSessionDataBLL.Insert(prscSessionData); txtData.Text = ""; BindGrid(); }
protected void btnUpdate_OnClick(object sender, EventArgs e) { PrescriptionSessionData prscSessionData = new PrescriptionSessionData(); prscSessionData.SessionDataId = Convert.ToInt16(Application["id"]); prscSessionData.SessionDataName = txtData.Text; PrescriptionSessionDataBLL.update(prscSessionData); txtData.Text = ""; btnSave.Visible = true; btnUpdate.Visible = false; BindGrid(); }
protected void grd_OnRowCommand(object sender, GridViewCommandEventArgs e) { int id; if (e.CommandName == "EditCommand") { id = Convert.ToInt32(e.CommandArgument); PrescriptionSessionData prsSessionData = PrescriptionSessionDataBLL.GetItem(id); txtData.Text = prsSessionData.SessionDataName; btnSave.Visible = false; btnUpdate.Visible = true; Application["id"] = id; } else if (e.CommandName == "DeleteCommand") { id = Convert.ToInt32(e.CommandArgument); PrescriptionSessionData prsSessionData = PrescriptionSessionDataBLL.GetItem(id); PrescriptionSessionDataBLL.Delete(prsSessionData); BindGrid(); } }
public static bool Delete(PrescriptionSessionData prescriptionSessionData) { return(PrescriptionSessionDataDAL.Delete(prescriptionSessionData.SessionDataId)); }
public static int update(PrescriptionSessionData prescriptionSessionData) { prescriptionSessionData.SessionDataId = PrescriptionSessionDataDAL.Update(prescriptionSessionData); return(prescriptionSessionData.SessionDataId); }
public static int Insert(PrescriptionSessionData prescriptionSessionData) { prescriptionSessionData.SessionDataId = PrescriptionSessionDataDAL.Insert(prescriptionSessionData); return(prescriptionSessionData.SessionDataId); }