protected void btnInvestigationFindings_Click(object sender, EventArgs e) { TbL_Complaints_Investigatior obj = new TbL_Complaints_Investigatior(); obj.Cmp_Id = Convert.ToInt16(comid); obj.InvestigationComments = txtinvestigation.Text.Trim(); obj.Create_User = 1; obj.IsDrugDivisionChart = chkDrugDiversion.Checked.ToString(); obj.IsPrescriptionProfileChart = chkPriscriptionprofile.Checked.ToString(); if (hfd_invid.Value == "") { obj.Cmp_Investigation_Id = 0; obj.Create_Date = DateTime.Now; ComplaintsTabLinq.ClsComplaints.InsertUpdateDeleteInvestigator(obj); string js = " altbox('Investigation findings added successfully.');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); } else { obj.Cmp_Investigation_Id = Convert.ToInt16(hfd_invid.Value); obj.Create_Date = DateTime.Now; obj.Modified_By = 1; ComplaintsTabLinq.ClsComplaints.InsertUpdateDeleteInvestigator(obj); string js = " altbox('Investigation findings updated successfully.');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); } Bindinvestigations(); }
public static void InsertUpdateDeleteInvestigator(TbL_Complaints_Investigatior objtblInvest) { using (ComplaintsTabDataContext dbInsertInvest = new ComplaintsTabDataContext()) { if (objtblInvest.Cmp_Investigation_Id == 0) { dbInsertInvest.USP_Complaints_InvestigatiorDetailsIUD(101, objtblInvest.Cmp_Investigation_Id, objtblInvest.Cmp_Id, "", "", objtblInvest.Create_Date.ToString(), objtblInvest.IsDrugDivisionChart, objtblInvest.IsPrescriptionProfileChart, objtblInvest.InvestigationComments, objtblInvest.Modified_By, objtblInvest.Modified_Date); } else { dbInsertInvest.USP_Complaints_InvestigatiorDetailsIUD(102, objtblInvest.Cmp_Investigation_Id, objtblInvest.Cmp_Id, "", "", objtblInvest.Create_Date.ToString(), objtblInvest.IsDrugDivisionChart, objtblInvest.IsPrescriptionProfileChart, objtblInvest.InvestigationComments, objtblInvest.Modified_By, objtblInvest.Modified_Date); } dbInsertInvest.SubmitChanges(); } }