public static void SummarysUpdateValues(TbL_Complaints_Summary ObjtblComp) { using (ComplaintsTabDataContext dbUpdateSummary = new ComplaintsTabDataContext()) { dbUpdateSummary.USP_ComplaintsSummary(102, Convert.ToInt32(ObjtblComp.SummaryComplaintID), Convert.ToInt32(ObjtblComp.Cmpid), ObjtblComp.SummaryArea, ObjtblComp.CreateUser, ObjtblComp.CreatedDate); dbUpdateSummary.SubmitChanges(); } }
public static void CompaintsUpdateValues(TbL_Complaint ObjCompUpdate) { using (ComplaintsTabDataContext dbUpdate = new ComplaintsTabDataContext()) { TbL_Complaint obj = ObjCompUpdate; dbUpdate.SubmitChanges(); } }
public static void InsertUpdateDeleteConclusion(TbL_Complaints_Conclusion objtblConclusion) { using (ComplaintsTabDataContext dbInsertConclus = new ComplaintsTabDataContext()) { if (objtblConclusion.ConclusionID == 0) { dbInsertConclus.USP_Complaints_ConclusionDetailsIUD(101, objtblConclusion.ConclusionID, objtblConclusion.Cmpid, objtblConclusion.ConclusionViolationID, objtblConclusion.ConclusionArea, objtblConclusion.CreatedUser, objtblConclusion.CreateDate); } else { dbInsertConclus.USP_Complaints_ConclusionDetailsIUD(102, objtblConclusion.ConclusionID, objtblConclusion.Cmpid, objtblConclusion.ConclusionViolationID, objtblConclusion.ConclusionArea, objtblConclusion.CreatedUser, objtblConclusion.CreateDate); } dbInsertConclus.SubmitChanges(); } }
public static void InsertUpdateDeleteRelevantHistory(TbL_Complaints_Relevant objtblCompRelevant) { using (ComplaintsTabDataContext dbInsertRelevant = new ComplaintsTabDataContext()) { if (objtblCompRelevant.RelevantHistoryID == 0) { dbInsertRelevant.USP_Complaints_TbL_Complaints_RelevantIUD(101, objtblCompRelevant.RelevantHistoryID, Convert.ToInt16(objtblCompRelevant.Cmpid), objtblCompRelevant.RelevantArea, objtblCompRelevant.CreatedUser, objtblCompRelevant.CreatedDate); } else { dbInsertRelevant.USP_Complaints_TbL_Complaints_RelevantIUD(102, objtblCompRelevant.RelevantHistoryID, Convert.ToInt16(objtblCompRelevant.Cmpid), objtblCompRelevant.RelevantArea, objtblCompRelevant.CreatedUser, objtblCompRelevant.CreatedDate); } dbInsertRelevant.SubmitChanges(); } }
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(); } }
protected void btnupdateComplaint_Click(object sender, EventArgs e) { string person = ""; string caseno = ""; string prvres = ""; string curres = ""; string pstatus = ""; string cstatus = ""; using (ComplaintsTabLinq.ComplaintsTabDataContext cdb = new ComplaintsTabDataContext()) { ComplaintsTabLinq.TbL_Complaint objcom = cdb.TbL_Complaints.Where(c => c.Complaint_ID == Convert.ToInt32(hfdautoid.Value)).SingleOrDefault(); pstatus = objcom.Complaint_Status; cstatus = ddlcompstatus.SelectedValue; prvres = objcom.PersonResponcible_ID; curres = ddlcompresposible.SelectedValue; objcom.Respondent_type = hfdRespondentType.Value.ToString() == "1" ? "1" : "2"; objcom.Respondent_ID = Convert.ToInt32(hfdRespondentId.Value); objcom.Source_Id = ddlcompsource.SelectedValue.ToString(); objcom.Category_Id = ddlcompcategory.SelectedValue.ToString(); if (txtcompdaterecive.Text != "") { objcom.DateReceived = Convert.ToDateTime(txtcompdaterecive.Text); } else { objcom.DateReceived = Convert.ToDateTime("01/01/1900"); } //if (txtcomodocketed.Text != "") // objcom.DateDocketed = Convert.ToDateTime(txtcomodocketed.Text); //else // objcom.DateDocketed = Convert.ToDateTime("01/01/1900"); objcom.Address1 = txtcompadd1.Text; objcom.Address2 = txtcompadd2.Text; objcom.City = txtcompcity.Text; //objcom.State = ddlcompstate.SelectedValue.ToString(); objcom.Zip = txtcompzip.Text; objcom.PersonResponcible_ID = ddlcompresposible.SelectedValue.ToString(); caseno = objcom.Complaint_Number; objcom.State = ddlcompstate.SelectedValue; if (txtdateinvgcomplete.Text != "") { objcom.DateInvestigationComplete = Convert.ToDateTime(txtdateinvgcomplete.Text); } else { objcom.DateInvestigationComplete = Convert.ToDateTime("01/01/1900"); } objcom.ComplaintType = "1"; objcom.InvestiGator_ID = ddlcompinvestigate.SelectedValue.ToString(); objcom.SecondInvestigatiorID = ddlcompinvestigate2.SelectedValue.ToString(); objcom.Compainant = txtcomplainant.Text; if (txtInvestigateAssigned.Text != "") { objcom.DateInvestigatorAssigned = Convert.ToDateTime(txtInvestigateAssigned.Text); } else { objcom.DateInvestigatorAssigned = Convert.ToDateTime("01/01/1900"); } if (txtInvestigatorReceived.Text != "") { objcom.DateInvestigatorReceived = Convert.ToDateTime(txtInvestigatorReceived.Text); } else { objcom.DateInvestigatorReceived = Convert.ToDateTime("01/01/1900"); } // objcom.Consultant = ddlNurseConsultant.SelectedValue.ToString(); objcom.Complaint_Status = ddlcompstatus.SelectedValue.ToString(); objcom.modifiedby = Convert.ToInt32(Session["UID"].ToString()); objcom.modifieddate = Convert.ToDateTime(System.DateTime.Now.ToString("MM/dd/yyyy")); if (prvres != curres) { ComplaintsTabLinq.tbl_Personresponsible_History his = new tbl_Personresponsible_History(); his.Complaint_id = objcom.Complaint_ID; his.Old_person = Convert.ToInt32(prvres); his.New_Person = Convert.ToInt32(curres); his.Changedby = Convert.ToInt32(Session["UID"].ToString()); his.Changeddt = DateTime.Now; cdb.tbl_Personresponsible_Histories.InsertOnSubmit(his); } if (pstatus != cstatus) { ComplaintsTabLinq.tbl_ComplaintStatusChanged_History cmpstatushis = new tbl_ComplaintStatusChanged_History(); cmpstatushis.Complaint_ID = objcom.Complaint_ID; cmpstatushis.Complaint_Number = objcom.Complaint_Number; cmpstatushis.Person_ID = objcom.Respondent_ID; cmpstatushis.Old_Status = pstatus; cmpstatushis.New_Status = cstatus; cmpstatushis.Date_Status_Changed = Convert.ToDateTime(DateTime.Now.ToShortDateString()); cmpstatushis.Modify_By = Session["UID"].ToString(); cmpstatushis.Modify_Date = Convert.ToDateTime(DateTime.Now.ToShortDateString()); cdb.tbl_ComplaintStatusChanged_Histories.InsertOnSubmit(cmpstatushis); } cdb.SubmitChanges(); } if (prvres != curres && ddlcompstatus.SelectedValue != "1049") { prvres = AdminLinq.Admin.Getemail(prvres); //prvres = prvres + ";" + "*****@*****.**"; curres = AdminLinq.Admin.Getemail(curres); DataTable dt = new DataTable(); dt = Utilities_Licensing.GetNameandLicno(Convert.ToInt32(hfdautoid.Value)); string st = @"<table cellspacing='0' width='100%' > <tr> <td style='text-align:left;' colspan='3'><b>This Email is to notify you that a case has been assigned to you.</b><br/><br/></td> </tr>"; foreach (DataRow dr in dt.Rows) { st = st + @"<tr> <td style='text-align: left;'><b>Respondent :</b></td> <td style='text-align:left;'>" + dr["Name"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License Type :</b></td> <td style='text-align:left;'>" + dr["License_Type"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License # :</b></td> <td style='text-align:left;'>" + dr["Lic_no"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align:left;'><b>License Status :</b></td> <td style='text-align:left;'>" + dr["LicenseStatus"].ToString() + "</td></tr>"; } if (chkattachdoc.Checked == true) { DataSet ds = Utilities_Licensing.GetDocumentPath(hfdautoid.Value); string docpath = ds.Tables[0].Rows[0]["docpath"].ToString(); string comments = ds.Tables[0].Rows[0]["Comments"].ToString(); if (docpath.ToString() != "") { st = st + @"<tr><td colspan='2'> </td></tr><tr> <td colspan='2' style='text-align:left;'><a href=" + docpath + " style='text-decoration:none;' target='blank'>Download Initial Complaint Document</a></td></tr>"; } if (comments != "" && comments != null) { st = st + @"<tr><td colspan='2'> </td></tr><tr> <td style='text-align:left;'>Comments :</td><td style='text-align:left'>" + comments + "</td></tr>"; } } st = st + "</table>"; if (ddlcompsource.SelectedValue == "1257" || ddlcompsource.SelectedValue == "1038" || ddlcompsource.SelectedValue == "1039" || ddlcompsource.SelectedValue == "1040" || ddlcompsource.SelectedValue == "1041" || ddlcompsource.SelectedValue == "1259") { Mail.SendMail(ddlcompresposible.SelectedItem.Text, curres, prvres, "Case Assigned : " + caseno, st); } else { prvres = prvres + ";" + "*****@*****.**" + ";" + "*****@*****.**" + ";" + "*****@*****.**"; Mail.SendMail(ddlcompresposible.SelectedItem.Text, curres, prvres, "Case Assigned : " + caseno, st); } } if (pstatus != "1049" && cstatus == "1049") { if (ddlcompsource.SelectedValue == "1257" || ddlcompsource.SelectedValue == "1038" || ddlcompsource.SelectedValue == "1039" || ddlcompsource.SelectedValue == "1040" || ddlcompsource.SelectedValue == "1041" || ddlcompsource.SelectedValue == "1259") { DataTable dt = new DataTable(); dt = Utilities_Licensing.GetNameandLicno(Convert.ToInt32(hfdautoid.Value)); string st = @"<table cellspacing='0' width='100%' > <tr> <td style='text-align:left;' colspan='3'><b>This Email is to notify you that a case :" + caseno + " Has Been Closed. </b><br/><br/></td></tr>"; foreach (DataRow dr in dt.Rows) { st = st + @"<tr> <td style='text-align: left;'><b>Respondent :</b></td> <td style='text-align:left;'>" + dr["Name"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License Type :</b></td> <td style='text-align:left;'>" + dr["License_Type"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License # :</b></td> <td style='text-align:left;'>" + dr["Lic_no"].ToString() + "</td></tr>"; } st = st + "</table>"; Mail.SendMail("", System.Configuration.ConfigurationManager.AppSettings["cmpclose"].ToString(), "", "Case Closed ", st); } else { DataTable dt = new DataTable(); dt = Utilities_Licensing.GetNameandLicno(Convert.ToInt32(hfdautoid.Value)); string st = @"<table cellspacing='0' width='100%' > <tr> <td style='text-align:left;' colspan='3'><b>This Email is to notify you that a case :" + caseno + " Has Been Closed. </b><br/><br/></td></tr>"; foreach (DataRow dr in dt.Rows) { st = st + @"<tr> <td style='text-align: left;'><b>Respondent :</b></td> <td style='text-align:left;'>" + dr["Name"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License Type :</b></td> <td style='text-align:left;'>" + dr["License_Type"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align: left;'><b>License # :</b></td> <td style='text-align:left;'>" + dr["Lic_no"].ToString() + "</td></tr>"; } st = st + "</table>"; Mail.SendMail("", System.Configuration.ConfigurationManager.AppSettings["cmpclose1"].ToString(), "", "Case Closed ", st); } } string js = " altbox('Complaints updated successfully.');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); }