示例#1
0
    public void AddVisit()
    {
        Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
        ArrayList         objAdd             = new ArrayList();

        objAdd.Add(((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID); //Case Id
        objAdd.Add(TXT_CURRENT_DATE.Text);                                    //Appointment date
        objAdd.Add("8.30");                                                   //Appointment time
        objAdd.Add("");                                                       //Notes
        // objAdd.Add(extddlDoctor.Text); vivek 2/2/10
        objAdd.Add(txtDoctorId.Text);
        objAdd.Add("TY000000000000000003");//Type
        objAdd.Add(txtCompanyID.Text);
        objAdd.Add("AM");
        objAdd.Add("9.00");
        objAdd.Add("AM");
        objAdd.Add("2");

        // add visit for FU only
        Bill_Sys_PatientVisitBO objPV = new Bill_Sys_PatientVisitBO();
        String szDefaultVisitTypeID   = objPV.GetVisitType(txtCompanyID.Text, "GET_FU_VALUE");

        objAdd.Add(szDefaultVisitTypeID);//Type

        _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
    }
示例#2
0
    protected void btnSave_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());
        }
        try
        {
            Boolean _valid = true;
            if (ddlStatus.SelectedValue == "1")
            {
                if (txtReScheduleDate.Text == "" && ddlReSchHours.SelectedValue == "00")
                {
                    lblMessage.Text = "Please enter Res-Schedule Date and Time";
                    _valid          = false;
                }
            }
            else if (ddlStatus.SelectedValue == "2")
            {
                if (ddlTestNames.GetSelectedIndices().Length == 0)
                {
                    lblMessage.Text = "Please select procedure";
                    _valid          = false;
                }

                DateTime dtPassDate;
                dtPassDate = Convert.ToDateTime(lblDate.Text);
                if (dtPassDate > DateTime.Now)
                {
                    lblMessage.Text = "Cannot complete visit at future date.";
                    _valid          = false;
                }
            }
            else if (ddlStatus.SelectedValue == "3")
            {
                DateTime dtPassDate;
                dtPassDate = Convert.ToDateTime(lblDate.Text);
                if (dtPassDate > DateTime.Now)
                {
                    lblMessage.Text = "Cannot no show visit at future date.";
                    _valid          = false;
                }
            }
            if (_valid == true)
            {
                string            eventID            = Request.QueryString["id"].ToString();
                Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                ArrayList         objAdd;
                if (ddlStatus.SelectedValue == "2")
                {
                    foreach (ListItem lst in ddlTestNames.Items)
                    {
                        if (lst.Selected == true)
                        {
                            objAdd = new ArrayList();
                            objAdd.Add(lst.Value);
                            objAdd.Add(eventID);
                            objAdd.Add(ddlStatus.SelectedValue);
                            _bill_Sys_Calender.Update_Event_RefferPrcedure(objAdd);

                            Bill_Sys_ReferalEvent _bill_Sys_ReferalEvent = new Bill_Sys_ReferalEvent();
                            ArrayList             arrOBJ = new ArrayList();
                            arrOBJ.Add(lblDoctorID.Text);
                            arrOBJ.Add(lst.Value);
                            arrOBJ.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                            arrOBJ.Add(lst.Value);
                            _bill_Sys_ReferalEvent.AddDoctorAmount(arrOBJ);

                            _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lst.Value, true, "");
                        }
                        else
                        {
                            _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lst.Value, false, eventID);
                        }
                    }
                }
                else if (ddlStatus.SelectedValue == "1")
                {
                    objAdd = new ArrayList();
                    objAdd.Add(txtCaseID.Text);
                    objAdd.Add(txtReScheduleDate.Text);
                    objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString());
                    objAdd.Add(txtNotes.Text);
                    objAdd.Add(lblDoctorID.Text);
                    objAdd.Add(lblTypeCode.Text);
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    objAdd.Add(ddlReSchTime.SelectedValue);
                    ////////////////
                    int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                    int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                    string endTime = ddlReSchTime.SelectedValue;
                    if (endMin >= 60)
                    {
                        endMin = endMin - 60;
                        endHr  = endHr + 1;
                        if (endHr > 12)
                        {
                            endHr = endHr - 12;
                            if (ddlReSchHours.SelectedValue != "12")
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                        else if (endHr == 12)
                        {
                            if (ddlReSchHours.SelectedValue != "12")
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                    }

                    //ddlEndHours.SelectedValue = endHr.ToString().PadLeft(2, '0');
                    //ddlEndMinutes.SelectedValue = endMin.ToString().PadLeft(2, '0');
                    //ddlEndTime.SelectedValue = endTime.ToString();
                    /////////////////
                    objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                    objAdd.Add(endTime.ToString());
                    _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    objAdd = new ArrayList();
                    objAdd.Add(txtCaseID.Text);
                    objAdd.Add(lblDoctorID.Text);
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    int reScheventID = _bill_Sys_Calender.GetEventID(objAdd);
                    if (_bill_Sys_Calender.CheckReferralExists(lblDoctorID.Text, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID) == true)
                    {
                        foreach (ListItem lstItem in ddlTestNames.Items)
                        {
                            if (lstItem.Selected == true)
                            {
                                objAdd = new ArrayList();
                                objAdd.Add(lstItem.Value);
                                objAdd.Add(reScheventID);
                                objAdd.Add(0);
                                _bill_Sys_Calender.Update_Event_RefferPrcedure(objAdd, eventID);
                                //              _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);


                                _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lstItem.Value, true, "");
                            }
                            else
                            {
                                _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lstItem.Value, false, reScheventID.ToString());
                            }
                        }
                    }
                }

                _bill_Sys_Calender = new Bill_Sys_Calender();
                objAdd             = new ArrayList();
                objAdd.Add(eventID);
                objAdd.Add(false);
                objAdd.Add(ddlStatus.SelectedValue);
                _bill_Sys_Calender.UPDATE_Event_Status(objAdd);
                // Start : Save appointment Notes.

                _DAO_NOTES_EO = new DAO_NOTES_EO();
                _DAO_NOTES_EO.SZ_MESSAGE_TITLE = "APPOINTMENT_UPDATED";
                //  _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + lblDate.Text;

                _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + lblDate.Text.Substring(0, lblDate.Text.IndexOf(" ")) + " " + lblHours.Text + ":" + lblMinutes.Text + " " + lblTime.Text;

                _DAO_NOTES_BO               = new DAO_NOTES_BO();
                _DAO_NOTES_EO.SZ_USER_ID    = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
                _DAO_NOTES_EO.SZ_CASE_ID    = txtCaseID.Text;
                _DAO_NOTES_EO.SZ_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                _DAO_NOTES_BO.SaveActivityNotes(_DAO_NOTES_EO);


                // End
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ss", "<script language='javascript'>  parent.document.getElementById('divid').style.visibility = 'hidden';window.parent.document.location.href=window.parent.document.location.href;window.self.close();window.parent.document.location.reload(); parent.document.getElementById('lblMsg').value='Event added successfully.';</script>");
            }
        }
        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());
        }
    }
示例#3
0
    protected void btnSave_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());
        }
        try
        {
            Boolean _valid = true;

            if (ddlStatus.SelectedValue == "1")
            {
                if (txtReScheduleDate.Text == "" && ddlReSchHours.SelectedValue == "00")
                {
                    lblMessage.Text = "Please enter Re-Schedule Date and Time";
                    _valid          = false;
                }
            }
            if (_valid == true)
            {
                string            eventID            = Request.QueryString["eventid"].ToString();
                Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                Bill_Sys_Event_BO _Bill_Sys_Event_BO = new Bill_Sys_Event_BO();
                ArrayList         objAdd;
                if (txtHaveLogin.Text == "1")
                {
                    if (ddlStatus.SelectedValue == "1")
                    {
                        int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                        int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                        string endTime = ddlReSchTime.SelectedValue;
                        if (endMin >= 60)
                        {
                            endMin = endMin - 60;
                            endHr  = endHr + 1;
                            if (endHr > 12)
                            {
                                endHr = endHr - 12;
                                if (ddlReSchHours.SelectedValue != "12")
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                            else if (endHr == 12)
                            {
                                if (ddlReSchHours.SelectedValue != "12")
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                        }

                        _Bill_Sys_Event_BO.UpdateRescheduledoctorvisits(txtEventID.Text, txtNotes.Text, txtReScheduleDate.Text, txtGroupCode.Text, ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString(), ddlReSchTime.SelectedValue, endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString(), endTime);
                    }
                    else if (ddlStatus.SelectedValue == "3")
                    {
                        Bill_Sys_Calender _bill_Sys_Calender1 = new Bill_Sys_Calender();
                        ArrayList         objAdd1             = new ArrayList();
                        objAdd1.Add(eventID);
                        objAdd1.Add(false);
                        objAdd1.Add(ddlStatus.SelectedValue);
                        _bill_Sys_Calender1.UPDATE_Event_Status(objAdd1);
                    }
                    else
                    {
                        usrMessage.PutMessage("Note: You cannot mark a visit as Completed if that patient visit is to be finalized by the doctor.");
                        usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                        usrMessage.Show();
                        return;
                    }
                }
                else
                {
                    if (ddlStatus.SelectedValue == "1")
                    {
                        lblMessage.Text = "";
                        objAdd          = new ArrayList();
                        objAdd.Add(txtCaseID.Text);
                        objAdd.Add(txtReScheduleDate.Text);
                        objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString());
                        objAdd.Add(txtNotes.Text);
                        objAdd.Add(txtDoctorid.Text);
                        objAdd.Add("TY000000000000000003");
                        objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                        objAdd.Add(ddlReSchTime.SelectedValue);
                        int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                        int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                        string endTime = ddlReSchTime.SelectedValue;
                        if (endMin >= 60)
                        {
                            endMin = endMin - 60;
                            endHr  = endHr + 1;
                            if (endHr > 12)
                            {
                                endHr = endHr - 12;
                                if (ddlReSchHours.SelectedValue != "12")
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                            else if (endHr == 12)
                            {
                                if (ddlReSchHours.SelectedValue != "12")
                                {
                                    if (endTime == "AM")
                                    {
                                        endTime = "PM";
                                    }
                                    else if (endTime == "PM")
                                    {
                                        endTime = "AM";
                                    }
                                }
                            }
                        }
                        objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                        objAdd.Add(endTime.ToString());
                        _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    }
                    _bill_Sys_Calender = new Bill_Sys_Calender();
                    objAdd             = new ArrayList();
                    objAdd.Add(eventID);
                    objAdd.Add(false);
                    objAdd.Add(ddlStatus.SelectedValue);
                    _bill_Sys_Calender.UPDATE_Event_Status(objAdd);
                }
                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 btnCheckinSave_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());
        }
        Boolean blInitialVisitNotExist = false;
        Boolean blInitialVisitExist    = false;
        Boolean blVisitExist           = false;


        CaseDetailsBO _caseDetailsBO = new CaseDetailsBO();

        lblCheckinMsg.Text = "";
        #region "Save"


        Bill_Sys_Visit_BO _bill_Sys_Visit_BO = new Bill_Sys_Visit_BO();
        ArrayList         objAdd             = new ArrayList();
        try
        {
            #region "Check for Valid visit"

            for (int i = 0; i < grdDoctorList.Items.Count; i++)
            {
                if (((CheckBox)grdDoctorList.Items[i].Cells[0].FindControl("chkVisit")).Checked == true)
                {
                    String szSelectedVisit   = ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).SelectedItem.Text;
                    String szSelectedVisitID = ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).SelectedItem.Value;
                    #region "Check for Visit"

                    Boolean       iEvisitExists = false;
                    Boolean       visitExists   = false;
                    SqlConnection con           = new SqlConnection(ConfigurationManager.AppSettings.Get("MyConnectionString"));
                    SqlCommand    comd          = new SqlCommand("SP_CHECK_INITIALE_VALUATIONEXISTS");
                    comd.CommandType = CommandType.StoredProcedure;
                    comd.Connection  = con;
                    comd.Connection.Open();
                    comd.Parameters.AddWithValue("@SZ_CASE_ID", Session["CHECK_IN_CASE_ID"].ToString());
                    comd.Parameters.AddWithValue("@SZ_COMPANY_ID", ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    comd.Parameters.AddWithValue("@SZ_PATIENT_ID", Session["CHECK_IN_PATIENT_ID"].ToString());
                    comd.Parameters.AddWithValue("@SZ_DOCTOR_ID", grdDoctorList.Items[i].Cells[1].Text);
                    comd.Parameters.AddWithValue("@VISIT_DATE", txtVisitDate.Text);
                    string visitType = ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).SelectedItem.Text;
                    comd.Parameters.AddWithValue("@VISIT_TYPE", visitType);
                    //int intCountVisits = Convert.ToInt32(comd.ExecuteScalar());

                    SqlParameter objIEExists = new SqlParameter("@INITIAL_EXISTS", SqlDbType.Bit);
                    objIEExists.Direction = ParameterDirection.Output;
                    comd.Parameters.Add(objIEExists);
                    SqlParameter objVisitStatus = new SqlParameter("@VISIT_EXISTS", SqlDbType.Bit, 20);
                    objVisitStatus.Direction = ParameterDirection.Output;
                    comd.Parameters.Add(objVisitStatus);
                    comd.ExecuteNonQuery();
                    comd.Connection.Close();

                    iEvisitExists = Convert.ToBoolean(objIEExists.Value);
                    visitExists   = Convert.ToBoolean(objVisitStatus.Value);
                    if (iEvisitExists == false && szSelectedVisit != "IE")
                    {
                        ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).BackColor = Color.Yellow;
                        blInitialVisitNotExist = true;
                        continue;
                    }
                    if (iEvisitExists == true && szSelectedVisit == "IE")
                    {
                        ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).BackColor = Color.Pink;
                        blInitialVisitExist = true;
                        continue;
                    }
                    if (visitExists == true)
                    {
                        ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).BackColor = Color.Red;
                        blVisitExist = true;
                        continue;
                    }
                    #endregion
                }
            }


            if (blInitialVisitNotExist == true)
            {
                lblCheckinMsg.Text = "<br>Schedules cannot be saved because patient shown in yellow color are visiting first time hence there visit type should be Initial Evaluation.";
                lblCheckinMsg.Focus();
                lblCheckinMsg.Visible = true;
            }
            if (blInitialVisitExist == true)
            {
                lblCheckinMsg.Text = lblCheckinMsg.Text + "<br>Schedules cannot be saved because patient shown in pink color already has Initial Evaluation.";
                lblCheckinMsg.Focus();
                lblCheckinMsg.Visible = true;
            }
            if (blVisitExist == true)
            {
                lblCheckinMsg.Text = lblCheckinMsg.Text + "<br>Schedules cannot be saved because patient shown in red color already has this visit";
                lblCheckinMsg.Focus();
                lblCheckinMsg.Visible = true;
            }



            #endregion

            #region "Save All Visit"
            if (blInitialVisitNotExist == false && blInitialVisitExist == false && blVisitExist == false)
            {
                for (int i = 0; i < grdDoctorList.Items.Count; i++)
                {
                    if (((CheckBox)grdDoctorList.Items[i].Cells[0].FindControl("chkVisit")).Checked == true)
                    {
                        String            szSelectedVisit    = ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).SelectedItem.Text;
                        String            szSelectedVisitID  = ((RadioButtonList)grdDoctorList.Items[i].Cells[3].FindControl("listVisitType")).SelectedItem.Value;
                        Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                        ArrayList         objAL = new ArrayList();
                        objAL.Add(Session["CHECK_IN_CASE_ID"].ToString());                                           //Case Id
                        objAL.Add(txtVisitDate.Text);                                                                //Appointment date
                        objAL.Add("8.30");                                                                           //Appointment time
                        objAL.Add("");                                                                               //Notes
                        objAL.Add(grdDoctorList.Items[i].Cells[1].Text);                                             // Doctor ID
                        objAL.Add("TY000000000000000003");                                                           //Type
                        objAL.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID); // Company ID
                        objAL.Add("AM");
                        objAL.Add("9.00");
                        objAL.Add("AM");
                        objAL.Add("0");
                        objAL.Add(szSelectedVisitID);
                        _bill_Sys_Calender.SaveEvent(objAL, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    }
                }
                if (blInitialVisitNotExist == false && blInitialVisitExist == false && blVisitExist == false)
                {
                    lblCheckinMsg.Text = "Visit Added Successfully.";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script language='javascript'> window.parent.document.location.href='Bill_Sys_SearchCase.aspx';window.self.close(); </script>");
                }
            }
            #endregion
        }
        catch (Exception ex)
        {
            log.Debug("Bill_Sys_CheckinPopup. Method - btnCheckinSave_Click : " + ex.Message.ToString());
            log.Debug("Bill_Sys_CheckinPopup. Method - btnCheckinSave_Click : " + ex.StackTrace.ToString());
            log.Debug("Bill_Sys_CheckinPopup. Method - btnCheckinSave_Click : " + ex.InnerException.Message.ToString());
            log.Debug("Bill_Sys_CheckinPopup. Method - btnCheckinSave_Click : " + ex.InnerException.StackTrace.ToString());
            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());
        }
        #endregion
    }
示例#5
0
    protected void btnUpdate_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());
        }

        _bill_Sys_Visit_BO = new Bill_Sys_Visit_BO();
        objAdd             = new ArrayList();
        Bill_Sys_Calender _bill_Sys_Calender;
        string            eventId = Request.QueryString["eventId"].ToString();

        try
        {
            if (Convert.ToDateTime(txtAppointmentDate.Text) > Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")) && ddlStatus.SelectedValue == "2")
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ss", "<script language='javascript'>alert('Visit for future date cannot be completed...!');</script>");
            }
            else
            {
                //////////

                //Boolean iEvisitExists = false;
                //Boolean visitExists = false;
                //Boolean reVisitExists = false;
                //SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings.Get("MyConnectionString"));
                //SqlCommand comd = new SqlCommand("SP_CHECK_UPDATE_INITIALE_VALUATIONEXISTS");
                //comd.CommandType = CommandType.StoredProcedure;
                //comd.Connection = con;
                //comd.Connection.Open();
                //comd.Parameters.AddWithValue("@SZ_CASE_ID", ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID);
                //comd.Parameters.AddWithValue("@SZ_COMPANY_ID", ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                //comd.Parameters.AddWithValue("@SZ_PATIENT_ID", ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_PATIENT_ID);
                //comd.Parameters.AddWithValue("@SZ_DOCTOR_ID", extddlDoctor.Text);
                //comd.Parameters.AddWithValue("@VISIT_DATE", txtAppointmentDate.Text);
                //comd.Parameters.AddWithValue("@I_EVENT_ID", eventId);
                ////int intCountVisits = Convert.ToInt32(comd.ExecuteScalar());
                //if (ddlStatus.SelectedValue == "1") { comd.Parameters.AddWithValue("@RE_VISIT_DATE", txtReDate.Text); }
                //SqlParameter objIEExists = new SqlParameter("@INITIAL_EXISTS", SqlDbType.Bit);
                //objIEExists.Direction = ParameterDirection.Output;
                //comd.Parameters.Add(objIEExists);
                //SqlParameter objVisitStatus = new SqlParameter("@VISIT_EXISTS", SqlDbType.Bit, 20);
                //objVisitStatus.Direction = ParameterDirection.Output;
                //comd.Parameters.Add(objVisitStatus);
                //SqlParameter objReVisitStatus = new SqlParameter("@RE_VISIT_EXISTS", SqlDbType.Bit, 20);
                //objReVisitStatus.Direction = ParameterDirection.Output;
                //comd.Parameters.Add(objReVisitStatus);
                //comd.ExecuteNonQuery();
                //comd.Connection.Close();

                //iEvisitExists = Convert.ToBoolean(objIEExists.Value);
                //visitExists = Convert.ToBoolean(objVisitStatus.Value);
                //if (objReVisitStatus.Value.ToString() != "") reVisitExists = Convert.ToBoolean(objReVisitStatus.Value);
                //if (iEvisitExists == false && extddlVisitType.Selected_Text != "IE")
                //{
                //    lblMsg.Text = "Schedule can not be saved patient is visiting first time hence there visit type should be Initial Evaluation.";
                //    lblMsg.Focus();
                //    lblMsg.Visible = true;
                //    return;
                //}
                //if (iEvisitExists == true && extddlVisitType.Selected_Text == "IE")
                //{
                //    lblMsg.Text = "Schedule can not be saved because patient already has Initial Evaluation.";
                //    lblMsg.Focus();
                //    lblMsg.Visible = true;
                //    return;
                //}
                //if (visitExists == true && ddlStatus.SelectedValue!="1")
                //{
                //    lblMsg.Text = "Schedule can not be saved because patient already has this visit";
                //    lblMsg.Focus();
                //    lblMsg.Visible = true;
                //    return;
                //}
                //if (reVisitExists == true && ddlStatus.SelectedValue == "1" && txtReEventID.Text == "")
                //{
                //    lblMsg.Text = "Schedule can not be saved because patient already has visit on re-schedule date";
                //    lblMsg.Focus();
                //    lblMsg.Visible = true;
                //    return;
                //}
                /////////

                ////////////RE-Schedule
                ////////////RE-Schedule add
                int    reendMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32(30);
                int    reendHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                string reendTime = ddlReSchTime.SelectedValue;
                if (reendMin >= 60)
                {
                    reendMin = reendMin - 60;
                    reendHr  = reendHr + 1;
                    if (reendHr > 12)
                    {
                        reendHr = reendHr - 12;
                        if (ddlReSchHours.SelectedValue != "12")
                        {
                            if (reendTime == "AM")
                            {
                                reendTime = "PM";
                            }
                            else if (reendTime == "PM")
                            {
                                reendTime = "AM";
                            }
                        }
                    }
                    else if (reendHr == 12)
                    {
                        if (ddlReSchHours.SelectedValue != "12")
                        {
                            if (reendTime == "AM")
                            {
                                reendTime = "PM";
                            }
                            else if (reendTime == "PM")
                            {
                                reendTime = "AM";
                            }
                        }
                    }
                }
                if (ddlStatus.SelectedValue == "1" && txtReEventID.Text == "")
                {
                    _bill_Sys_Calender = new Bill_Sys_Calender();
                    objAdd             = new ArrayList();
                    objAdd.Add(txtCaseID.Text);                                                                          //Case Id
                    objAdd.Add(txtReDate.Text);                                                                          //Appointment date
                    objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString()); //Appointment time
                    objAdd.Add("");                                                                                      //Notes
                    objAdd.Add(extddlDoctor.Text);
                    objAdd.Add("TY000000000000000003");
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    objAdd.Add(ddlReSchTime.SelectedValue);
                    objAdd.Add(reendHr.ToString().PadLeft(2, '0') + "." + reendMin.ToString().PadLeft(2, '0'));
                    objAdd.Add(reendTime);
                    if (Convert.ToDateTime(txtReDate.Text) >= Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")))
                    {
                        objAdd.Add("0");
                    }
                    else
                    {
                        objAdd.Add("2");
                    }
                    objAdd.Add(extddlVisitType.Text);
                    _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    ArrayList objGetEvent = new ArrayList();
                    objGetEvent.Add(txtCaseID.Text);
                    objGetEvent.Add(extddlDoctor.Text);
                    objGetEvent.Add(txtCompanyID.Text);
                    int reeventID = _bill_Sys_Calender.GetEventID(objGetEvent);
                    txtReEventID.Text = reeventID.ToString();
                    foreach (ListItem lstItem in ddlTestNames.Items)
                    {
                        if (lstItem.Selected == true)
                        {
                            objAdd = new ArrayList();
                            objAdd.Add(lstItem.Value);
                            objAdd.Add(reeventID);
                            if (Convert.ToDateTime(txtReDate.Text) >= Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")))
                            {
                                objAdd.Add("0");
                            }
                            else
                            {
                                objAdd.Add("2");
                            }
                            _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);
                        }
                    }
                    // Start : Save appointment Notes.

                    _DAO_NOTES_EO = new DAO_NOTES_EO();
                    _DAO_NOTES_EO.SZ_MESSAGE_TITLE = "APPOINTMENT_ADDED";
                    _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + txtReDate.Text;

                    _DAO_NOTES_BO               = new DAO_NOTES_BO();
                    _DAO_NOTES_EO.SZ_USER_ID    = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
                    _DAO_NOTES_EO.SZ_CASE_ID    = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
                    _DAO_NOTES_EO.SZ_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                    _DAO_NOTES_BO.SaveActivityNotes(_DAO_NOTES_EO);

                    lblMsg.Visible = true;
                    lblMsg.Text    = "Appointment Added successfully.";
                }
                ////////////RE-Schedule add
                ////////////RE-Schedule Update
                else if (ddlStatus.SelectedValue == "1" && txtReEventID.Text != "")
                {
                    _bill_Sys_Calender = new Bill_Sys_Calender();
                    objAdd             = new ArrayList();
                    objAdd.Add(txtReEventID.Text);                                                                       //event Id
                    objAdd.Add(txtCaseID.Text);                                                                          //Case Id
                    objAdd.Add(txtReDate.Text);                                                                          //Appointment date
                    objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString()); //Appointment time
                    objAdd.Add("");                                                                                      //Notes
                    objAdd.Add(extddlDoctor.Text);
                    objAdd.Add("TY000000000000000003");
                    objAdd.Add(txtCompanyID.Text);

                    objAdd.Add(ddlReSchTime.SelectedValue);
                    objAdd.Add(reendHr.ToString().PadLeft(2, '0') + "." + reendMin.ToString().PadLeft(2, '0'));
                    objAdd.Add(reendTime);

                    if (Convert.ToDateTime(txtReDate.Text) >= Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")))
                    {
                        objAdd.Add("0");
                    }
                    else
                    {
                        objAdd.Add("2");
                    }
                    objAdd.Add(extddlVisitType.Text);
                    _bill_Sys_Calender.UPDATEEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());

                    _bill_Sys_Calender.Delete_Event_RefferPrcedure(Convert.ToInt32(txtReEventID.Text));

                    foreach (ListItem lstItem in ddlTestNames.Items)
                    {
                        if (lstItem.Selected == true)
                        {
                            objAdd = new ArrayList();
                            objAdd.Add(lstItem.Value);
                            objAdd.Add(txtReEventID.Text);
                            if (ddlTestNames.Visible == true && Convert.ToDateTime(txtAppointmentDate.Text) >= Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")))
                            {
                                objAdd.Add("0");
                            }
                            else
                            {
                                objAdd.Add("2");
                            }
                            _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);
                        }
                    }
                }
                ////////////RE-Schedule Update
                ////////////RE-Schedule

                _bill_Sys_Calender = new Bill_Sys_Calender();
                objAdd             = new ArrayList();
                objAdd.Add(eventId);                                                                       //event Id
                objAdd.Add(txtCaseID.Text);                                                                //Case Id
                objAdd.Add(txtAppointmentDate.Text);                                                       //Appointment date
                objAdd.Add(ddlHours.SelectedValue.ToString() + "." + ddlMinutes.SelectedValue.ToString()); //Appointment time
                objAdd.Add("");                                                                            //Notes
                objAdd.Add(extddlDoctor.Text);
                objAdd.Add("TY000000000000000003");
                objAdd.Add(txtCompanyID.Text);

                int    endMin  = Convert.ToInt32(ddlMinutes.SelectedValue) + Convert.ToInt32(30);
                int    endHr   = Convert.ToInt32(ddlHours.SelectedValue);
                string endTime = ddlTime.SelectedValue;
                if (endMin >= 60)
                {
                    endMin = endMin - 60;
                    endHr  = endHr + 1;
                    if (endHr > 12)
                    {
                        endHr = endHr - 12;
                        if (ddlHours.SelectedValue != "12")
                        {
                            if (endTime == "AM")
                            {
                                endTime = "PM";
                            }
                            else if (endTime == "PM")
                            {
                                endTime = "AM";
                            }
                        }
                    }
                    else if (endHr == 12)
                    {
                        if (ddlHours.SelectedValue != "12")
                        {
                            if (endTime == "AM")
                            {
                                endTime = "PM";
                            }
                            else if (endTime == "PM")
                            {
                                endTime = "AM";
                            }
                        }
                    }
                }
                objAdd.Add(ddlTime.SelectedValue);
                objAdd.Add(endHr.ToString().PadLeft(2, '0') + "." + endMin.ToString().PadLeft(2, '0'));
                objAdd.Add(endTime);



                objAdd.Add(ddlStatus.SelectedValue);
                objAdd.Add(extddlVisitType.Text);
                if (ddlStatus.SelectedValue == "1")
                {
                    objAdd.Add(txtReEventID.Text);
                    objAdd.Add(txtReDate.Text);
                }
                _bill_Sys_Calender.UPDATEEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                _bill_Sys_Calender.Delete_Event_RefferPrcedure(Convert.ToInt32(eventId));


                ArrayList Olditems = new ArrayList();
                foreach (ListItem lstItem in ddlTestNames.Items)
                {
                    if (lstItem.Selected == true)
                    {
                        objAdd = new ArrayList();
                        objAdd.Add(lstItem.Value);
                        objAdd.Add(eventId);
                        if (ddlTestNames.Visible == true && Convert.ToDateTime(txtAppointmentDate.Text) >= Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy")))
                        {
                            objAdd.Add("0");
                        }
                        else
                        {
                            objAdd.Add("2");
                        }
                        _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);
                    }

                    if (ddlOldTestNames.Items.FindByValue(lstItem.Value).Selected == true && lstItem.Selected == false)
                    {
                        Olditems.Add(lstItem.Value);
                    }
                }

                //////////If appointment is updated from schedule to completed and remove any existing treatments
                if (txtVisitStatus.Text == "0" && ddlStatus.SelectedValue != "0" && Olditems.Count > 0)
                {
                    _bill_Sys_Calender = new Bill_Sys_Calender();
                    objAdd             = new ArrayList();
                    objAdd.Add(txtCaseID.Text);                                                                //Case Id
                    objAdd.Add(txtAppointmentDate.Text);                                                       //Appointment date
                    objAdd.Add(ddlHours.SelectedValue.ToString() + "." + ddlMinutes.SelectedValue.ToString()); //Appointment time
                    objAdd.Add("");                                                                            //Notes
                    objAdd.Add(extddlDoctor.Text);
                    objAdd.Add("TY000000000000000003");
                    objAdd.Add(txtCompanyID.Text);

                    objAdd.Add(ddlTime.SelectedValue);
                    objAdd.Add(endHr.ToString().PadLeft(2, '0') + "." + endMin.ToString().PadLeft(2, '0'));
                    objAdd.Add(endTime);
                    objAdd.Add("0");
                    objAdd.Add(extddlVisitType.Text);

                    _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());

                    ArrayList objOldGetEvent = new ArrayList();
                    objOldGetEvent.Add(txtCaseID.Text);
                    objOldGetEvent.Add(extddlDoctor.Text);
                    objOldGetEvent.Add(txtCompanyID.Text);
                    int neweventID = _bill_Sys_Calender.GetEventID(objOldGetEvent);

                    foreach (Object obj in Olditems)
                    {
                        objAdd = new ArrayList();
                        objAdd.Add(obj.ToString());
                        objAdd.Add(neweventID);
                        objAdd.Add("0");
                        _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);
                    }
                }
                //////////If appointment is updated from schedule to completed and remove any existing treatments


                // Start : Save appointment Notes.

                _DAO_NOTES_EO = new DAO_NOTES_EO();
                _DAO_NOTES_EO.SZ_MESSAGE_TITLE = "APPOINTMENT_ADDED";
                _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + txtAppointmentDate.Text;

                _DAO_NOTES_BO               = new DAO_NOTES_BO();
                _DAO_NOTES_EO.SZ_USER_ID    = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
                _DAO_NOTES_EO.SZ_CASE_ID    = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
                _DAO_NOTES_EO.SZ_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                _DAO_NOTES_BO.SaveActivityNotes(_DAO_NOTES_EO);

                lblMsg.Visible = true;
                lblMsg.Text    = "Appointment Updated successfully.";

                if (Request.QueryString["GRD_ID"] != null)
                {
                    Session["GRD_ID"] = Request.QueryString["GRD_ID"].ToString();
                }
                Page.ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script language='javascript'> window.parent.document.location.href='Bill_SysPatientDesk.aspx';window.self.close(); </script>");
            }
        }
        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 btnUpdateStatus_Click(object sender, EventArgs e)
    {
        int iFlag = 0;
        Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
        Bill_Sys_Event_BO _Bill_Sys_Event_BO = new Bill_Sys_Event_BO();
        ArrayList         objAdd;

        try
        {
            Boolean _valid = true;

            if (_valid == true)
            {
                for (int i = 0; i < this.grdTodayVisit.Rows.Count; i++)
                {
                    CheckBox chkSelected  = (CheckBox)grdTodayVisit.Rows[i].FindControl("ChkSelect");
                    string   iEventID     = "";
                    string   szcaseID     = "";
                    string   szDoctorID   = "";
                    string   szhave_login = "";
                    string   szgroupcode  = "";
                    if (chkSelected.Checked == true)
                    {
                        iEventID     = grdTodayVisit.DataKeys[i]["I_EVENT_ID"].ToString();
                        szcaseID     = grdTodayVisit.DataKeys[i]["SZ_CASE_ID"].ToString();
                        szDoctorID   = grdTodayVisit.DataKeys[i]["SZ_DOCTOR_ID"].ToString();
                        szhave_login = grdTodayVisit.DataKeys[i]["IS_HAVE_LOGIN"].ToString();
                        szgroupcode  = grdTodayVisit.DataKeys[i]["GROUP_CODE"].ToString();
                        if (szhave_login == "1")
                        {
                            if (ddlStatus.SelectedValue == "1")
                            {
                                int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                                int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                                string endTime = ddlReSchTime.SelectedValue;
                                if (endMin >= 60)
                                {
                                    endMin = endMin - 60;
                                    endHr  = endHr + 1;
                                    if (endHr > 12)
                                    {
                                        endHr = endHr - 12;
                                        if (ddlReSchHours.SelectedValue != "12")
                                        {
                                            if (endTime == "AM")
                                            {
                                                endTime = "PM";
                                            }
                                            else if (endTime == "PM")
                                            {
                                                endTime = "AM";
                                            }
                                        }
                                    }
                                    else if (endHr == 12)
                                    {
                                        if (ddlReSchHours.SelectedValue != "12")
                                        {
                                            if (endTime == "AM")
                                            {
                                                endTime = "PM";
                                            }
                                            else if (endTime == "PM")
                                            {
                                                endTime = "AM";
                                            }
                                        }
                                    }
                                }

                                _Bill_Sys_Event_BO.UpdateRescheduledoctorvisits(iEventID, "", txtReScheduleDate.Text, szgroupcode, ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString(), ddlReSchTime.SelectedValue, endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString(), endTime);
                            }
                            else if (ddlStatus.SelectedValue == "3")
                            {
                                Bill_Sys_Calender _bill_Sys_Calender1 = new Bill_Sys_Calender();
                                ArrayList         objAdd1             = new ArrayList();
                                objAdd1.Add(iEventID);
                                objAdd1.Add(false);
                                objAdd1.Add(ddlStatus.SelectedValue);
                                _bill_Sys_Calender1.UPDATE_Event_Status(objAdd1);
                            }

                            else
                            {
                                iFlag = 1;
                            }
                        }
                        else
                        {
                            if (ddlStatus.SelectedValue == "1")
                            {
                                objAdd = new ArrayList();
                                objAdd.Add(szcaseID);
                                objAdd.Add(txtReScheduleDate.Text);
                                objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString());
                                objAdd.Add("");
                                objAdd.Add(szDoctorID);
                                objAdd.Add("TY000000000000000003");
                                objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                                objAdd.Add(ddlReSchTime.SelectedValue);
                                int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                                int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                                string endTime = ddlReSchTime.SelectedValue;
                                if (endMin >= 60)
                                {
                                    endMin = endMin - 60;
                                    endHr  = endHr + 1;
                                    if (endHr > 12)
                                    {
                                        endHr = endHr - 12;
                                        if (ddlReSchHours.SelectedValue != "12")
                                        {
                                            if (endTime == "AM")
                                            {
                                                endTime = "PM";
                                            }
                                            else if (endTime == "PM")
                                            {
                                                endTime = "AM";
                                            }
                                        }
                                    }
                                    else if (endHr == 12)
                                    {
                                        if (ddlReSchHours.SelectedValue != "12")
                                        {
                                            if (endTime == "AM")
                                            {
                                                endTime = "PM";
                                            }
                                            else if (endTime == "PM")
                                            {
                                                endTime = "AM";
                                            }
                                        }
                                    }
                                }
                                objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                                objAdd.Add(endTime.ToString());
                                _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                            }


                            _bill_Sys_Calender = new Bill_Sys_Calender();
                            objAdd             = new ArrayList();
                            objAdd.Add(iEventID);
                            objAdd.Add(false);
                            objAdd.Add(ddlStatus.SelectedValue);
                            _bill_Sys_Calender.UPDATE_Event_Status(objAdd);
                        }
                    }
                }



                lblMessage.Text = "";
                usrMessage.PutMessage("Update Sucessfully ...");
                usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                usrMessage.Show();
                Bind_Grid();
                //Bill_Sys_Event_BO objGetVisits = new Bill_Sys_Event_BO();
                //DataSet dsVisits = new DataSet();
                //dsVisits = objGetVisits.GetCaledarVisits(txtGetDay.Value, txtCompanyID.Text, extddlSpeciality.Text, txtProvider.Text, extddlDoctor.Text);
                //grdTodayVisit.XGridBindSearch();
                //ViewState["griddata"] = dsVisits;
                clear();
            }
        }
        catch (Exception ex)
        {
        }
    }