private void save_data() { try { List <LabDynamicControl> lstCtrl = new List <LabDynamicControl>(); foreach (Control c in panel4.Controls) { foreach (Control ctrl in c.Controls) { LabDynamicControl obj = new LabDynamicControl(); obj.ctrlName = ctrl.Name; obj.ctrlValue = ctrl.Text; lstCtrl.Add(obj); } } int flag = 0; int iSaved = 0; //Save Lab Test Result ComArugments args = new ComArugments(); args.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultEntryId] = ResultEntryId; args.ParamList[clsLabCommon.Laboratory.TestResultEntry.BillId] = BillId; args.ParamList[clsLabCommon.Laboratory.TestResultEntry.ReceivedDateTime] = dtpReceivedDateTime.Value; args.ParamList[clsLabCommon.Laboratory.TestResultEntry.ReportedDateTime] = dtpReportedDateTime.Value; if (ResultEntryId == 0) { ResultEntryId = objBusiness.SaveResultEntryInfo(args); } else { iSaved = objBusiness.SaveResultEntryInfo(args); } //Delete all the entries in Test_Result_Entry Table and Save the Details int iDeleted = objBusiness.DeletePatientResultEntry(ResultEntryId); foreach (DataRow row in dtResultEntry.Rows) { LabDynamicControl obj = lstCtrl.Find(ctrl => ctrl.ctrlName.Equals("txt" + row["test_field_id"].ToString() + "_" + row["investigation_id"].ToString())); string resultValue = string.Empty; if (obj != null) { resultValue = obj.ctrlValue; } ComArugments argsDetail = new ComArugments(); argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultEntryId] = ResultEntryId; argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.InvestigationId] = row["investigation_id"].ToString(); argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.TestFieldId] = row["test_field_id"].ToString(); //argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultValue] = resultValue; argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultValue] = resultValue.Replace("'", "''"); flag = objBusiness.SaveResultEntryDetailInfo(argsDetail); } objBusiness.commitTransction(); if (flag > 0) { MessageBox.Show("Result Entry is saved", "Result Entry", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Result Entry", MessageBoxButtons.OK, MessageBoxIcon.Error); objBusiness.rollBackTransation(); } }
private void save_data() { try { int flag = 0; int iSaved = 0; //Save Lab Test Result ComArugments args = new ComArugments(); args.ParamList[CIS.Common.DischargeSummary.DischargeSummaryId] = DischargeSummaryId; args.ParamList[CIS.Common.DischargeSummary.DischargeSummaryNumber] = "1"; args.ParamList[CIS.Common.DischargeSummary.DischargeSummaryDate] = DateTime.Now; args.ParamList[CIS.Common.DischargeSummary.PatientId] = txtPatientId.Text; args.ParamList[CIS.Common.DischargeSummary.VisitNumber] = txtVisitNo.Text; args.ParamList[CIS.Common.DischargeSummary.DischargeDoctorId] = cboDischargeDoctor.SelectedValue.ToString(); args.ParamList[CIS.Common.DischargeSummary.DischargeDate] = dtpDischargeDateTime.Value; args.ParamList[CIS.Common.DischargeSummary.Diagnosis] = rtxtDiagnosis.Text; args.ParamList[CIS.Common.DischargeSummary.OperativeFindings] = rtxtOperativeFindings.Text; args.ParamList[CIS.Common.DischargeSummary.Procedure] = rtxtProcedure.Text; args.ParamList[CIS.Common.DischargeSummary.Summary] = rtxtSummary.Text; args.ParamList[CIS.Common.DischargeSummary.ConditionAtAdmission] = rtxtConditionAtAdmission.Text; args.ParamList[CIS.Common.DischargeSummary.Investigations] = rtxtInvestigations.Text; args.ParamList[CIS.Common.DischargeSummary.TreatmentGiven] = rtxtTreatmentGiven.Text; args.ParamList[CIS.Common.DischargeSummary.ConditionAtDischarge] = rtxtConditionAtDischarge.Text; args.ParamList[CIS.Common.DischargeSummary.TreatmentAdviced] = rtxtTreatmentAdviced.Text; args.ParamList[CIS.Common.DischargeSummary.ReviewOn] = rtxtReviewOn.Text; args.ParamList[CIS.Common.DischargeSummary.LastUpdatedUser] = 1; //args.ParamList[CIS.Common.DischargeSummary.FollowupDetailId] = rtxtConditionAtDischarge.Text; args.ParamList[clsLabCommon.Laboratory.TestResultEntry.ReportedDateTime] = dtpDischargeDateTime.Value; if (DischargeSummaryId == 0) { iSaved = objBusiness.SaveDischargeSummary(args); } else { iSaved = objBusiness.SaveResultEntryInfo(args); } //Delete all the entries in Test_Result_Entry Table and Save the Details //int iDeleted = objBusiness.DeletePatientResultEntry(ResultEntryId); //foreach (DataRow row in dtResultEntry.Rows) //{ // LabDynamicControl obj = lstCtrl.Find(ctrl => ctrl.ctrlName.Equals("txt" + row["test_field_id"].ToString() + "_" + row["investigation_id"].ToString())); // string resultValue = string.Empty; // if (obj != null) // resultValue = obj.ctrlValue; // ComArugments argsDetail = new ComArugments(); // argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultEntryId] = ResultEntryId; // argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.InvestigationId] = row["investigation_id"].ToString(); // argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.TestFieldId] = row["test_field_id"].ToString(); // //argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultValue] = resultValue; // argsDetail.ParamList[clsLabCommon.Laboratory.TestResultEntry.ResultValue] = resultValue.Replace("'", "''"); // flag = objBusiness.SaveResultEntryDetailInfo(argsDetail); //} //objBusiness.commitTransction(); if (iSaved == 1) { MessageBox.Show("Discharge Summary is saved", "Discharge Summary", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Discharge Summary", MessageBoxButtons.OK, MessageBoxIcon.Error); //objBusiness.rollBackTransation(); } }