public string UpdateVisitTime(ArrayList arrevent) { conn = new SqlConnection(strConn); conn.Open(); SqlTransaction transaction; transaction = conn.BeginTransaction(); string szResult = ""; try { for (int icount = 0; icount < arrevent.Count; icount++) { Bill_Sys_Event_DAO objEvent = new Bill_Sys_Event_DAO(); objEvent = (Bill_Sys_Event_DAO)arrevent[icount]; comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_CHANGE_EVENT_TIME"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", objEvent.I_EVENT_ID); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@DT_EVENT_TIME", objEvent.DT_EVENT_TIME); comm.Parameters.AddWithValue("@DT_EVENT_TIME_TYPE", objEvent.DT_EVENT_TIME_TYPE); comm.Parameters.AddWithValue("@DT_EVENT_END_TIME", objEvent.DT_EVENT_END_TIME); comm.Parameters.AddWithValue("@DT_EVENT_END_TIME_TYPE", objEvent.DT_EVENT_END_TIME_TYPE); comm.ExecuteNonQuery(); } transaction.Commit(); szResult = "success"; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); transaction.Rollback(); } finally { conn.Close(); } return(szResult); }
protected void btnchnagetime_Click(object sender, EventArgs e) {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } Bill_Sys_Event_BO _Bill_Sys_Event_BO = new Bill_Sys_Event_BO(); try { ArrayList arradd = new ArrayList(); int endMin = Convert.ToInt32(ddlchangeReSchMinutes.SelectedValue) + Convert.ToInt32("30"); int endHr = Convert.ToInt32(ddlchangeReSchHours.SelectedValue); string endTime = ddlchangeReSchTime.SelectedValue; if (endMin >= 60) { endMin = endMin - 60; endHr = endHr + 1; if (endHr > 12) { endHr = endHr - 12; if (ddlchangeReSchHours.SelectedValue != "12") { if (endTime == "AM") { endTime = "PM"; } else if (endTime == "PM") { endTime = "AM"; } } } else if (endHr == 12) { if (ddlchangeReSchHours.SelectedValue != "12") { if (endTime == "AM") { endTime = "PM"; } else if (endTime == "PM") { endTime = "AM"; } } } } Bill_Sys_Event_DAO _Bill_Sys_Event_DAO = new Bill_Sys_Event_DAO(); _Bill_Sys_Event_DAO.I_EVENT_ID = txtEventID.Text; _Bill_Sys_Event_DAO.SZ_COMPANY_ID = txtCompanyId.Text; _Bill_Sys_Event_DAO.DT_EVENT_TIME = ddlchangeReSchHours.SelectedValue.ToString() + "." + ddlchangeReSchMinutes.SelectedValue.ToString(); _Bill_Sys_Event_DAO.DT_EVENT_TIME_TYPE = ddlchangeReSchTime.SelectedValue; _Bill_Sys_Event_DAO.DT_EVENT_END_TIME = endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString(); _Bill_Sys_Event_DAO.DT_EVENT_END_TIME_TYPE = endTime.ToString(); arradd.Add(_Bill_Sys_Event_DAO); _Bill_Sys_Event_BO.UpdateVisitTime(arradd); usrMessage.PutMessage("Save Sucessfully ..."); usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); usrMessage.Show(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
protected void btnAdd_Click(object sender, EventArgs e) { string str; this.lblMsg.Text = ""; int num = 4; string str1 = ""; string str2 = ""; string str3 = ""; int num1 = 0; string str4 = ""; int num2 = 0; string str5 = ""; int num3 = 0; string str6 = ""; string str7 = ""; string str8 = ""; if (this.txtCasID.Text == "") { this.usrMessage.PutMessage("Please Select Case First "); this.usrMessage.SetMessageType(0); this.usrMessage.Show(); } else { ArrayList arrayLists = new ArrayList(); string str9 = "30"; int num4 = Convert.ToInt32(this.ddlMinutes_event.SelectedValue) + Convert.ToInt32(str9); int num5 = Convert.ToInt32(this.ddlHours_event.SelectedValue); string selectedValue = this.ddlTime_event.SelectedValue; if (num4 >= 60) { num4 = num4 - 60; num5++; if (num5 <= 12) { if (num5 == 12 && this.ddlHours.SelectedValue != "12") { if (selectedValue != "AM") { if (selectedValue == "PM") { selectedValue = "AM"; } } else { selectedValue = "PM"; } } } else { num5 = num5 - 12; if (this.ddlHours.SelectedValue != "12") { if (selectedValue != "AM") { if (selectedValue == "PM") { selectedValue = "AM"; } } else { selectedValue = "PM"; } } } } string str10 = num5.ToString().PadLeft(2, '0'); string str11 = num4.ToString().PadLeft(2, '0'); string str12 = selectedValue.ToString(); string str13 = this.Session["SendPatientToDoctor"].ToString(); if (!(str13.ToLower() == "true") || !this.chkAddToDoctor.Checked) { for (int i = 0; i < this.grdDoctor.VisibleRowCount; i++) { GridViewDataColumn item = (GridViewDataColumn)this.grdDoctor.Columns[0]; CheckBox checkBox = (CheckBox)this.grdDoctor.FindRowCellTemplateControl(i, item, "chkSelect"); if (checkBox.Checked) { string[] strArrays = new string[1]; strArrays[0] = "CODE"; string str14 = this.grdDoctor.GetRowValues(i, strArrays).ToString(); string[] strArrays1 = new string[1]; strArrays1[0] = "DESCRIPTION"; string str15 = this.grdDoctor.GetRowValues(i, strArrays1).ToString(); SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.AppSettings.Get("MyConnectionString")); SqlCommand sqlCommand = new SqlCommand("SP_CHECK_INITIALE_VALUATIONEXISTS"); sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Connection = sqlConnection; sqlCommand.Connection.Open(); sqlCommand.Parameters.AddWithValue("@SZ_CASE_ID", this.txtCasID.Text); sqlCommand.Parameters.AddWithValue("@SZ_COMPANY_ID", ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID); sqlCommand.Parameters.AddWithValue("@SZ_PATIENT_ID", this.txtPatientId.Text); sqlCommand.Parameters.AddWithValue("@SZ_DOCTOR_ID", str14); sqlCommand.Parameters.AddWithValue("@VISIT_DATE", this.txtEventDate.Text); sqlCommand.Parameters.AddWithValue("@VISIT_TYPE", extddlVisitType.Selected_Text); SqlParameter sqlParameter = new SqlParameter("@INITIAL_EXISTS", SqlDbType.Bit); sqlParameter.Direction = ParameterDirection.Output; sqlCommand.Parameters.Add(sqlParameter); SqlParameter sqlParameter1 = new SqlParameter("@VISIT_EXISTS", SqlDbType.Bit, 20); sqlParameter1.Direction = ParameterDirection.Output; sqlCommand.Parameters.Add(sqlParameter1); sqlCommand.ExecuteNonQuery(); sqlCommand.Connection.Close(); bool flag = Convert.ToBoolean(sqlParameter.Value); bool flag1 = Convert.ToBoolean(sqlParameter1.Value); if (!flag1) { this.billAppointmetDate.Add(this.txtEventDate.Text); } if (flag || !(this.extddlVisitType.Selected_Text != "IE")) { if (!flag || !(this.extddlVisitType.Selected_Text == "IE")) { if (!flag1) { Bill_Sys_Event_DAO billSysEventDAO = new Bill_Sys_Event_DAO(); string[] strArrays2 = new string[1]; strArrays2[0] = "CODE"; string str16 = this.grdDoctor.GetRowValues(i, strArrays2).ToString(); billSysEventDAO.SZ_CASE_ID = this.txtCasID.Text; billSysEventDAO.DT_EVENT_DATE = this.txtEventDate.Text; billSysEventDAO.DT_EVENT_TIME = string.Concat(this.ddlHours_event.SelectedValue.ToString(), ".", this.ddlMinutes_event.SelectedValue.ToString()); billSysEventDAO.SZ_EVENT_NOTES = this.txtNotes.Text; billSysEventDAO.SZ_DOCTOR_ID = str16; billSysEventDAO.SZ_TYPE_CODE_ID = "TY000000000000000003"; billSysEventDAO.SZ_COMPANY_ID = this.txtCompanyID.Text; billSysEventDAO.DT_EVENT_TIME_TYPE = this.ddlTime_event.SelectedValue; billSysEventDAO.DT_EVENT_END_TIME = string.Concat(str10.ToString(), ".", str11.ToString()); billSysEventDAO.DT_EVENT_END_TIME_TYPE = str12; billSysEventDAO.SZ_USER_ID = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString(); billSysEventDAO.SZ_VISIT_TYPE = this.extddlVisitType.Text; arrayLists.Add(billSysEventDAO); } else { if (num3 != num) { str5 = string.Concat(str5, str8, str15, " "); num3++; } else { str5 = string.Concat(str5, str8, str15, " "); num3 = 0; } } } else { if (num2 != num) { str4 = string.Concat(str4, str7, str15, " "); num2++; } else { str4 = string.Concat(str4, str7, str15, " "); num2 = 0; } } } else { if (num1 != num) { str3 = string.Concat(str3, str6, str15, " "); num1++; } else { str3 = string.Concat(str3, str6, str15, " "); num1 = 0; } } } } Bill_Sys_Event_BO billSysEventBO = new Bill_Sys_Event_BO(); str = billSysEventBO.SaveEvent(arrayLists); } else { for (int j = 0; j < this.grdDoctor.VisibleRowCount; j++) { GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grdDoctor.Columns[0]; CheckBox checkBox1 = (CheckBox)this.grdDoctor.FindRowCellTemplateControl(j, gridViewDataColumn, "chkSelect"); if (checkBox1.Checked) { Bill_Sys_Event_DAO billSysEventDAO1 = new Bill_Sys_Event_DAO(); string[] strArrays3 = new string[1]; strArrays3[0] = "CODE"; string str17 = this.grdDoctor.GetRowValues(j, strArrays3).ToString(); billSysEventDAO1.SZ_CASE_ID = this.txtCasID.Text; billSysEventDAO1.DT_EVENT_DATE = this.txtEventDate.Text; billSysEventDAO1.DT_EVENT_TIME = string.Concat(this.ddlHours_event.SelectedValue.ToString(), ".", this.ddlMinutes_event.SelectedValue.ToString()); billSysEventDAO1.SZ_EVENT_NOTES = this.txtNotes.Text; billSysEventDAO1.SZ_DOCTOR_ID = str17; billSysEventDAO1.SZ_TYPE_CODE_ID = "TY000000000000000003"; billSysEventDAO1.SZ_COMPANY_ID = this.txtCompanyID.Text; billSysEventDAO1.DT_EVENT_TIME_TYPE = this.ddlTime_event.SelectedValue; billSysEventDAO1.DT_EVENT_END_TIME = string.Concat(str10.ToString(), ".", str11.ToString()); billSysEventDAO1.DT_EVENT_END_TIME_TYPE = str12; string[] strArrays4 = new string[1]; strArrays4[0] = "SZ_USER_ID"; billSysEventDAO1.SZ_USER_ID = this.grdDoctor.GetRowValues(j, strArrays4).ToString(); billSysEventDAO1.SZ_BILLER_ID = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString(); string[] strArrays5 = new string[1]; strArrays5[0] = "DocName"; billSysEventDAO1.SZ_DOCTOR_NAME = this.grdDoctor.GetRowValues(j, strArrays5).ToString(); string[] strArrays6 = new string[1]; strArrays6[0] = "GROUP_CODE"; billSysEventDAO1.SZ_GROUP_CODE = this.grdDoctor.GetRowValues(j, strArrays6).ToString(); arrayLists.Add(billSysEventDAO1); } } Bill_Sys_Event_BO billSysEventBO1 = new Bill_Sys_Event_BO(); str = billSysEventBO1.SaveDocEvent(arrayLists); } if (!(str2 == "") || !(str3 == "") || !(str4 == "") || !(str5 == "")) { if (str1 != "") { this.Session["CreateBill"] = null; this.Session["CreateBill"] = this.billAppointmetDate; } if (str2 != "") { this.lblMsg.Text = string.Concat(this.lblMsg.Text, str2, " -- Visit for future date cannot be added.<br/>"); } if (str3 != "") { if (num1 <= 2) { this.lblMsg.Text = string.Concat(this.lblMsg.Text, " -- Schedule can not be saved for ", str3, " because patient is visiting first time hence there visit type should be Initial Evaluation.<br/>"); } else { this.lblMsg.Text = string.Concat(this.lblMsg.Text, "<br/> -- Schedule can not be saved for ", str3, " because patient is visiting first time hence there visit type should be Initial Evaluation.<br/>"); } } if (str4 != "") { this.lblMsg.Text = string.Concat(this.lblMsg.Text, " -- Schedule can not be saved for ", str4, " because patient already has Initial Evaluation.<br/>"); } if (str5 != "") { this.lblMsg.Text = string.Concat(this.lblMsg.Text, " -- Schedule can not be saved because for ", str5, " because patient already has this visit.<br/>"); } } else { this.Session["CreateBill"] = null; this.Session["CreateBill"] = this.billAppointmetDate; } this.lblMsg.Focus(); this.lblMsg.Visible = true; if (str != "success") { this.usrMessage.PutMessage(string.Concat("Eroor ", str)); this.usrMessage.SetMessageType(0); this.usrMessage.Show(); return; } else { if (arrayLists.Count >= 1) { this.usrMessage.PutMessage("Visit Save successfully.."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); return; } } } }
public string SaveDocEvent(ArrayList arrEventInfo) { string szResult = ""; conn = new SqlConnection(strConn); conn.Open(); SqlTransaction transaction; transaction = conn.BeginTransaction(); try { for (int icount = 0; icount < arrEventInfo.Count; icount++) { Bill_Sys_Event_DAO objEvent = new Bill_Sys_Event_DAO(); objEvent = (Bill_Sys_Event_DAO)arrEventInfo[icount]; comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_ADD_DOCTOR_VISIT"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@sz_case_id", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@dt_event_date", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@dt_event_time", objEvent.DT_EVENT_TIME); comm.Parameters.AddWithValue("@sz_event_notes", objEvent.SZ_EVENT_NOTES); comm.Parameters.AddWithValue("@sz_doctor_id", objEvent.SZ_DOCTOR_ID); comm.Parameters.AddWithValue("@sz_type_code_id", objEvent.SZ_TYPE_CODE_ID); comm.Parameters.AddWithValue("@sz_company_id", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@dt_event_time_type", objEvent.DT_EVENT_TIME_TYPE); comm.Parameters.AddWithValue("@dt_event_end_time", objEvent.DT_EVENT_END_TIME); comm.Parameters.AddWithValue("@dt_event_end_time_type", objEvent.DT_EVENT_END_TIME_TYPE); comm.Parameters.AddWithValue("@SZ_BILLER_ID", objEvent.SZ_BILLER_ID); comm.Parameters.AddWithValue("@sz_user_id", objEvent.SZ_USER_ID); SqlDataReader dr = comm.ExecuteReader(); string szEventID = ""; while (dr.Read()) { szEventID = dr[0].ToString(); } dr.Close(); if (szEventID != "") { DataSet dsInfo = new DataSet(); comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_GET_PATIENT_DETAILS_FOR_DOC_VISIT"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@SZ_CASE_ID", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); SqlDataAdapter da = new SqlDataAdapter(comm); da.Fill(dsInfo); if (dsInfo.Tables.Count > 0) { if (dsInfo.Tables[0].Rows.Count > 0) { string szCaseNo = dsInfo.Tables[0].Rows[0]["SZ_CASE_NO"].ToString(); string szPatientName = dsInfo.Tables[0].Rows[0]["SZ_PATIENT_NAME"].ToString(); string szInsName = dsInfo.Tables[0].Rows[0]["SZ_INSURANCE_NAME"].ToString(); string szDOA = dsInfo.Tables[0].Rows[0]["DT_ACCIDENT"].ToString(); string szClaimNo = dsInfo.Tables[0].Rows[0]["SZ_CLAIM_NUMBER"].ToString(); string szPatientFirstName = dsInfo.Tables[0].Rows[0]["FIRST_NAME"].ToString(); string szPatientLastName = dsInfo.Tables[0].Rows[0]["LAST_NAME"].ToString(); string szPatientId = dsInfo.Tables[0].Rows[0]["SZ_PATIENT_ID"].ToString(); if (objEvent.SZ_GROUP_CODE == "PT") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_MST_PT_NOTES"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_PATIENT_NAME", szPatientName); comm.Parameters.AddWithValue("@SZ_CASE_NO", szCaseNo); comm.Parameters.AddWithValue("@DT_DATE_OF_ACCIDENT", szDOA); comm.Parameters.AddWithValue("@SZ_INSURANCE_COMPANY", szInsName); comm.Parameters.AddWithValue("@SZ_CLAIM_NO", szClaimNo); comm.Parameters.AddWithValue("@DT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } else if (objEvent.SZ_GROUP_CODE == "CH") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_MST_CH_NOTES"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_PATIENT_NAME", szPatientName); comm.Parameters.AddWithValue("@SZ_CASE_NO", szCaseNo); comm.Parameters.AddWithValue("@SZ_DOCTOR_NAME", objEvent.SZ_DOCTOR_NAME); comm.Parameters.AddWithValue("@DT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } else if (objEvent.SZ_GROUP_CODE == "AC") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_ACCU_FOLLOWUP"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_PATIENT_LAST_NAME", szPatientLastName); comm.Parameters.AddWithValue("@SZ_PATIENT_FIRST_NAME", szPatientFirstName); comm.Parameters.AddWithValue("@DT_DOA", szDOA); comm.Parameters.AddWithValue("@DT_CURRENT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@SZ_CASE_ID", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } else if (objEvent.SZ_GROUP_CODE == "SYN") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_SYN_FOLLOWUP"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_PATIENT_LAST_NAME", szPatientLastName); comm.Parameters.AddWithValue("@SZ_PATIENT_FIRST_NAME", szPatientFirstName); comm.Parameters.AddWithValue("@DT_DOA", szDOA); comm.Parameters.AddWithValue("@DT_CURRENT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } else if (objEvent.SZ_GROUP_CODE == "LMT") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_MST_LMT"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@FLAG", "ADD"); } else if (objEvent.SZ_GROUP_CODE == "WB" || objEvent.SZ_GROUP_CODE == "AQU") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_MST_WB_NOTES"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_PATIENT_NAME", szPatientName); comm.Parameters.AddWithValue("@SZ_CASE_NO", szCaseNo); comm.Parameters.AddWithValue("@TREATMENT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } else if (objEvent.SZ_GROUP_CODE == "IM") { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_SAVE_MST_IM_FOLLOWING"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID", szEventID); comm.Parameters.AddWithValue("@SZ_CASE_ID", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@SZ_CREATED_USER_ID", objEvent.SZ_USER_ID); comm.Parameters.AddWithValue("@SZ_UPDATED_USER_ID", objEvent.SZ_USER_ID); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@SZ_PATIENT_ID", szPatientId); comm.Parameters.AddWithValue("@DT_EVENT_DATE", objEvent.DT_EVENT_DATE); comm.ExecuteNonQuery(); } } } } } transaction.Commit(); szResult = "success"; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); transaction.Rollback(); } finally { conn.Close(); } return(szResult); }
public string SaveEvent(ArrayList arrEventInfo) { string szResult = ""; conn = new SqlConnection(strConn); conn.Open(); SqlTransaction transaction; transaction = conn.BeginTransaction(); try { for (int icount = 0; icount < arrEventInfo.Count; icount++) { Bill_Sys_Event_DAO objEvent = new Bill_Sys_Event_DAO(); objEvent = (Bill_Sys_Event_DAO)arrEventInfo[icount]; comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_TXN_CALENDAR_EVENT"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@SZ_CASE_ID ", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@DT_EVENT_DATE", objEvent.DT_EVENT_DATE); comm.Parameters.AddWithValue("@DT_EVENT_TIME", objEvent.DT_EVENT_TIME); comm.Parameters.AddWithValue("@SZ_EVENT_NOTES", objEvent.SZ_EVENT_NOTES); comm.Parameters.AddWithValue("@SZ_DOCTOR_ID", objEvent.SZ_DOCTOR_ID); comm.Parameters.AddWithValue("@SZ_TYPE_CODE_ID", objEvent.SZ_TYPE_CODE_ID); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@DT_EVENT_TIME_TYPE", objEvent.DT_EVENT_TIME_TYPE); comm.Parameters.AddWithValue("@DT_EVENT_END_TIME", objEvent.DT_EVENT_END_TIME); comm.Parameters.AddWithValue("@DT_EVENT_END_TIME_TYPE", objEvent.DT_EVENT_END_TIME_TYPE); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.Parameters.AddWithValue("@I_STATUS", "0"); comm.Parameters.AddWithValue("@SZ_USER_ID", objEvent.SZ_USER_ID); comm.Parameters.AddWithValue("@SZ_VISIT_TYPE", objEvent.SZ_VISIT_TYPE); comm.ExecuteNonQuery(); int eventID = 0; comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "GET_EVENT_ID"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@SZ_CASE_ID ", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@SZ_DOCTOR_ID", objEvent.SZ_DOCTOR_ID); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); SqlDataReader dr = comm.ExecuteReader(); while (dr.Read()) { if (dr[0] != DBNull.Value) { eventID = (int)dr[0]; } } dr.Close(); Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender(); if (_bill_Sys_Calender.CheckReferralExists(objEvent.SZ_DOCTOR_ID, objEvent.SZ_COMPANY_ID) == true) { comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "UPDATE_EVENT_STATUS"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@I_EVENT_ID ", eventID.ToString()); comm.Parameters.AddWithValue("@BT_STATUS", "false"); comm.Parameters.AddWithValue("@I_STATUS", "0"); comm.ExecuteNonQuery(); } string szActiveDesc = "Date : " + objEvent.DT_EVENT_DATE + objEvent.DT_EVENT_TIME + objEvent.DT_EVENT_TIME_TYPE; XmlDocument doc = new XmlDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "XML/ActivityNotesXML.xml"); XmlNodeList nl = doc.SelectNodes("NOTES/" + "APPOINTMENT_ADDED" + "/MESSAGE"); string strMessage = szActiveDesc + " " + nl.Item(0).InnerText; comm = new SqlCommand(); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandText = "SP_TXN_NOTES"; comm.CommandType = CommandType.StoredProcedure; comm.Connection = conn; comm.Transaction = transaction; comm.Parameters.AddWithValue("@SZ_NOTE_CODE", "NOT1004"); comm.Parameters.AddWithValue("@SZ_CASE_ID", objEvent.SZ_CASE_ID); comm.Parameters.AddWithValue("@SZ_USER_ID", objEvent.SZ_USER_ID); comm.Parameters.AddWithValue("@SZ_NOTE_TYPE", "NTY0001"); comm.Parameters.AddWithValue("@SZ_NOTE_DESCRIPTION", strMessage); comm.Parameters.AddWithValue("@IS_DENIED", objEvent.IS_DENIED); comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID); comm.Parameters.AddWithValue("@FLAG", "ADD"); comm.ExecuteNonQuery(); } transaction.Commit(); szResult = "success"; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); transaction.Rollback(); } finally { conn.Close(); } return(szResult); }
protected void btnAdd_Click(object sender, EventArgs e) { string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } this.lblMsg.Text = ""; int num = 4; string str = ""; string str2 = ""; string str3 = ""; int num2 = 0; string str4 = ""; int num3 = 0; string str5 = ""; int num4 = 0; string str6 = ""; string str7 = ""; string str8 = ""; if (this.txtCaseID.Text != "") { ArrayList list = new ArrayList(); string str9 = "30"; int num5 = Convert.ToInt32(this.ddlMinutes_event.SelectedValue) + Convert.ToInt32(str9); int num6 = Convert.ToInt32(this.ddlHours_event.SelectedValue); string selectedValue = this.ddlTime_event.SelectedValue; if (num5 >= 60) { num5 -= 60; num6++; if (num6 > 12) { num6 -= 12; if (this.ddlHours.SelectedValue != "12") { if (selectedValue == "AM") { selectedValue = "PM"; } else if (selectedValue == "PM") { selectedValue = "AM"; } } } else if ((num6 == 12) && (this.ddlHours.SelectedValue != "12")) { if (selectedValue == "AM") { selectedValue = "PM"; } else if (selectedValue == "PM") { selectedValue = "AM"; } } } string str11 = num6.ToString().PadLeft(2, '0'); string str12 = num5.ToString().PadLeft(2, '0'); string str13 = selectedValue.ToString(); string str14 = ""; if ((this.Session["SendPatientToDoctor"].ToString().ToLower() == "true") && this.chkAddToDoctor.Checked) { for (int i = 0; i < this.grdDoctor.VisibleRowCount; i++) { GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grdDoctor.Columns[0]; CheckBox box = (CheckBox)this.grdDoctor.FindRowCellTemplateControl(i, gridViewDataColumn, "chkSelect"); if (box.Checked) { Bill_Sys_Event_DAO t_dao = new Bill_Sys_Event_DAO(); string str16 = this.grdDoctor.GetRowValues(i, new string[] { "CODE" }).ToString(); t_dao.SZ_CASE_ID = this.txtCaseID.Text; t_dao.DT_EVENT_DATE = this.txtEventDate.Text; t_dao.DT_EVENT_TIME = this.ddlHours_event.SelectedValue.ToString() + "." + this.ddlMinutes_event.SelectedValue.ToString(); t_dao.SZ_EVENT_NOTES = this.txtNotes.Text; t_dao.SZ_DOCTOR_ID = str16; t_dao.SZ_TYPE_CODE_ID = "TY000000000000000003"; t_dao.SZ_COMPANY_ID = this.txtCompanyID.Text; t_dao.DT_EVENT_TIME_TYPE = this.ddlTime_event.SelectedValue; t_dao.DT_EVENT_END_TIME = str11.ToString() + "." + str12.ToString(); t_dao.DT_EVENT_END_TIME_TYPE = str13; t_dao.SZ_USER_ID = grdDoctor.GetRowValues(i, "SZ_USER_ID").ToString(); t_dao.SZ_BILLER_ID = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString(); t_dao.SZ_DOCTOR_NAME = grdDoctor.GetRowValues(i, "DocName").ToString(); t_dao.SZ_GROUP_CODE = grdDoctor.GetRowValues(i, "GROUP_CODE").ToString(); list.Add(t_dao); } } Bill_Sys_Event_BO objAddEvent = new Bill_Sys_Event_BO(); str14 = objAddEvent.SaveDocEvent(list); } else { for (int j = 0; j < this.grdDoctor.VisibleRowCount; j++) { GridViewDataColumn c = (GridViewDataColumn)grdDoctor.Columns[0]; // checkbox column CheckBox chkSelected = (CheckBox)grdDoctor.FindRowCellTemplateControl(j, c, "chkSelect"); if (chkSelected.Checked) { string str17 = grdDoctor.GetRowValues(j, "CODE").ToString(); string str18 = this.grdDoctor.GetRowValues(j, "DESCRIPTION").ToString(); bool flag = false; bool flag2 = false; SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings.Get("MyConnectionString")); SqlCommand command = new SqlCommand("SP_CHECK_INITIALE_VALUATIONEXISTS"); command.CommandType = CommandType.StoredProcedure; command.Connection = connection; command.Connection.Open(); command.Parameters.AddWithValue("@SZ_CASE_ID", this.txtCaseID.Text); command.Parameters.AddWithValue("@SZ_COMPANY_ID", ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID); command.Parameters.AddWithValue("@SZ_PATIENT_ID", this.txtPatientID.Text); command.Parameters.AddWithValue("@SZ_DOCTOR_ID", str17); command.Parameters.AddWithValue("@VISIT_DATE", this.txtEventDate.Text); SqlParameter parameter = new SqlParameter("@INITIAL_EXISTS", SqlDbType.Bit); parameter.Direction = ParameterDirection.Output; command.Parameters.Add(parameter); SqlParameter parameter2 = new SqlParameter("@VISIT_EXISTS", SqlDbType.Bit, 20); parameter2.Direction = ParameterDirection.Output; command.Parameters.Add(parameter2); command.ExecuteNonQuery(); command.Connection.Close(); flag = Convert.ToBoolean(parameter.Value); flag2 = Convert.ToBoolean(parameter2.Value); if (!flag2) { this.billAppointmetDate.Add(this.txtEventDate.Text); } if (!flag && (this.extddlVisitType.Selected_Text != "IE")) { if (num2 == num) { str3 = str3 + str6 + str18 + " "; num2 = 0; } else { str3 = str3 + str6 + str18 + " "; num2++; } } else if (flag && (this.extddlVisitType.Selected_Text == "IE")) { if (num3 == num) { str4 = str4 + str7 + str18 + " "; num3 = 0; } else { str4 = str4 + str7 + str18 + " "; num3++; } } else if (flag2) { if (num4 == num) { str5 = str5 + str8 + str18 + " "; num4 = 0; } else { str5 = str5 + str8 + str18 + " "; num4++; } } else { Bill_Sys_Event_DAO t_dao2 = new Bill_Sys_Event_DAO(); string str19 = this.grdDoctor.GetRowValues(j, "CODE").ToString(); t_dao2.SZ_CASE_ID = this.txtCaseID.Text; t_dao2.DT_EVENT_DATE = this.txtEventDate.Text; t_dao2.DT_EVENT_TIME = this.ddlHours_event.SelectedValue.ToString() + "." + this.ddlMinutes_event.SelectedValue.ToString(); t_dao2.SZ_EVENT_NOTES = this.txtNotes.Text; t_dao2.SZ_DOCTOR_ID = str19; t_dao2.SZ_TYPE_CODE_ID = "TY000000000000000003"; t_dao2.SZ_COMPANY_ID = this.txtCompanyID.Text; t_dao2.DT_EVENT_TIME_TYPE = this.ddlTime_event.SelectedValue; t_dao2.DT_EVENT_END_TIME = str11.ToString() + "." + str12.ToString(); t_dao2.DT_EVENT_END_TIME_TYPE = str13; t_dao2.SZ_USER_ID = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString(); t_dao2.SZ_VISIT_TYPE = extddlVisitType.Text; list.Add(t_dao2); } } } str14 = new Bill_Sys_Event_BO().SaveEvent(list); } if (((str2 == "") && (str3 == "")) && ((str4 == "") && (str5 == ""))) { this.Session["CreateBill"] = null; this.Session["CreateBill"] = this.billAppointmetDate; } else { if (str != "") { this.Session["CreateBill"] = null; this.Session["CreateBill"] = this.billAppointmetDate; } if (str2 != "") { this.lblMsg.Text = this.lblMsg.Text + str2 + " -- Visit for future date cannot be added.<br/>"; } if (str3 != "") { if (num2 > 2) { this.lblMsg.Text = this.lblMsg.Text + "<br/> -- Schedule can not be saved for " + str3 + " is visiting first time hence there visit type should be Initial Evaluation.<br/>"; } else { this.lblMsg.Text = this.lblMsg.Text + " -- Schedule can not be saved for " + str3 + " is visiting first time hence there visit type should be Initial Evaluation.<br/>"; } } if (str4 != "") { this.lblMsg.Text = this.lblMsg.Text + " -- Schedule can not be saved for " + str4 + " because patient already has Initial Evaluation.<br/>"; } if (str5 != "") { this.lblMsg.Text = this.lblMsg.Text + " -- Schedule can not be saved because for " + str5 + " because patient already has this visit.<br/>"; } } this.lblMsg.Focus(); this.lblMsg.Visible = true; if (str14 == "success") { if (list.Count >= 1) { usrMessage.PutMessage("Visit Save successfully.."); usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); usrMessage.Show(); if (chkTransportation.Checked) { BillSearchDAO hdao = new BillSearchDAO(); try { hdao.GetInsertTransport(this.extddlTransport.Selected_Text, this.extddlTransport.Text, this.txtCompanyID.Text, this.txtCaseID.Text, this.txtFromDate.Text, this.ddlHours.SelectedItem.ToString(), this.ddlMinutes.SelectedItem.ToString(), this.ddlTime.SelectedItem.ToString()); this.usrMessage.PutMessage("Save Successfully ...!"); usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); DataSet set = new DataSet(); set = hdao.getTransportinfo(this.txtCaseID.Text, this.txtCompanyID.Text); this.grdTransport.DataSource = set; this.grdTransport.DataBind(); this.divTrans.Style.Add("visibility", "visible"); this.tb1.Visible = true; this.tb3.Visible = true; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string errorMessage = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + errorMessage); } this.divTrans.Style.Add("visibility", "visible"); divTransGrd.Style.Add("visibility", "visible"); } } } else { this.usrMessage.PutMessage("Eroor " + str14); this.usrMessage.SetMessageType(0); this.usrMessage.Show(); } this.tb1.Visible = true; this.tb3.Visible = true; } else { this.usrMessage.PutMessage("Please Select Case First "); this.usrMessage.SetMessageType(0); this.usrMessage.Show(); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }