Example #1
0
    protected void carTabPage_ActiveTabChanged(object source, DevExpress.Web.TabControlEventArgs e)
    {
        int activeTabIndex = this.carTabPage.ActiveTabIndex;

        if (activeTabIndex == 1)
        {
            Bill_Sys_Event_BO billSysEventBO = new Bill_Sys_Event_BO();
            DataSet           visits         = billSysEventBO.GetVisits(this.txtCasID.Text, this.txtCompanyID.Text);
            this.grdShowVisit.DataSource = visits;
            this.grdShowVisit.DataBind();
        }
    }
    private void BindDoctorList()
    {
        string str = this.Session["SendPatientToDoctor"].ToString();

        if (str.ToLower() == "false")
        {
            Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
            DataSet           doctorlList        = _bill_Sys_Calender.GetDoctorlList(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            this.grdDoctor.DataSource = doctorlList;
            this.grdDoctor.DataBind();
        }
        else if (str.ToLower() == "true")
        {
            Bill_Sys_Event_BO objDocList = new Bill_Sys_Event_BO();
            DataSet           dsDoctor   = objDocList.GetDoctorlList(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            grdDoctor.DataSource = dsDoctor;
            grdDoctor.DataBind();
        }
    }
Example #3
0
    protected void BindData(string caseid, string compnayid, string Status)
    {
        try
        {
            Bill_Sys_Event_BO objEventbo  = new Bill_Sys_Event_BO();
            DataSet           ds          = objEventbo.GetCaseWiserReport(caseid, compnayid, Status);
            string            specialty   = "";
            StringBuilder     bl          = new StringBuilder();
            DataTable         dtspecialty = ds.Tables[0].DefaultView.ToTable(true, "sz_procedure_group");
            bl.Append("<table border='1'  style='border: 1px solid blue' >  ");
            bl.Append(" <tr>");

            // bl.Append("<table border='1'  style='border: 0.1px solid blue' 'border-collapse: collapse'>  ");

            for (int i = 0; i < dtspecialty.Rows.Count; i++)
            {
                bl.Append(" <td valign = 'top' >");
                bl.Append("<table > ");
                bl.Append(" <tr> ");
                DataRow[] dr = ds.Tables[0].Select("sz_procedure_group='" + dtspecialty.Rows[i][0].ToString() + "'");
                bl.Append("<td valign='top' bgcolor='#E5E7E9'>" + dtspecialty.Rows[i][0].ToString() + "</td> </tr>");

                for (int j = 0; j < dr.Length; j++)
                {
                    bl.Append(" <tr> ");


                    bl.Append("<td valign='top'>" + dr[j][2].ToString() + "</td></tr> ");
                }

                bl.Append("</table> ");
                bl.Append(" </td >");
            }
            bl.Append(" </tr> ");
            bl.Append("</table> ");
            dataDiv.InnerHtml = bl.ToString();
        }
        catch (Exception ex)
        {
        }
    }
Example #4
0
    protected void carTabPage_ActiveTabChanged(object source, DevExpress.Web.TabControlEventArgs 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
        {
            carTabPage.Visible = true;
            int iActiveIndex = carTabPage.ActiveTabIndex;
            if (iActiveIndex == 1)
            {
                Bill_Sys_Event_BO objGetVisits = new Bill_Sys_Event_BO();
                DataSet           dsSpecVisits = new DataSet();
                dsSpecVisits             = objGetVisits.GetDoctorSpecialtyVisits(txtCompanyId.Text, txtFromDate.Text, txtToDate.Text, extddlSpeciality.Text, extddlDoctor.Text, "PROC");
                grdSpecVisits.DataSource = dsSpecVisits;
                grdSpecVisits.DataBind();
                Session["SpecAllVisits"] = dsSpecVisits;
            }
        }
        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());
        }
    }
Example #5
0
    private void BindDoctorList()
    {
        string str = this.Session["SendPatientToDoctor"].ToString();

        if (str.ToLower() != "false")
        {
            if (str.ToLower() == "true")
            {
                Bill_Sys_Event_BO billSysEventBO = new Bill_Sys_Event_BO();
                DataSet           doctorlList    = billSysEventBO.GetDoctorlList(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                this.grdDoctor.DataSource = doctorlList;
                this.grdDoctor.DataBind();
            }
            return;
        }
        else
        {
            Bill_Sys_Calender billSysCalender = new Bill_Sys_Calender();
            DataSet           dataSet         = billSysCalender.GetDoctorlList(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            this.grdDoctor.DataSource = dataSet;
            this.grdDoctor.DataBind();
            return;
        }
    }
Example #6
0
    //public void GetData()
    //{
    //    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
    //    {
    //        ArrayList aList = new ArrayList();
    //        aList.Add(rblNoshow.SelectedValue.ToString());
    //        aList.Add(txtCompanyId.Text);
    //        aList.Add(txtFromDateRange.Text);
    //        aList.Add(txtToDateRange.Text);
    //        aList.Add(extddlNoShowProvider.Text);
    //        aList.Add(extddlNoShowDoctor.Text);
    //        Bill_Sys_Event_BO objBill_sys_report = new Bill_Sys_Event_BO();
    //        DataSet dsValues = new DataSet();
    //        dsValues = objBill_sys_report.GetVisitByType(aList);
    //        grdNoShow.DataSource = dsValues;
    //        grdNoShow.DataBind();
    //        StringBuilder bh = new StringBuilder();
    //        bh.Append("<table border='1' width='100%'> <tr>");
    //        for (int j = 0; j < dsValues.Tables[1].Rows.Count; j++)
    //        {
    //            bh.Append("<td style='width: 30px;'><b>" + dsValues.Tables[1].Rows[j][0].ToString() + "</b></td>");
    //        }
    //        bh.Append(" </tr> </table>");
    //        GridViewDataColumn m = (GridViewDataColumn)this.grdNoShow.Columns[8];
    //        HtmlGenericControl lblh = (HtmlGenericControl)this.grdNoShow.FindHeaderTemplateControl(m, "lblHeader");
    //         if (lblh != null)
    //        {
    //            lblh.InnerHtml = bh.ToString();
    //        }

    //        for (int i = 0; i < grdNoShow.VisibleRowCount; i++)
    //        {
    //            GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grdNoShow.Columns[8];
    //            HtmlGenericControl lbl = (HtmlGenericControl)this.grdNoShow.FindRowCellTemplateControl(i, gridViewDataColumn, "lblNoShow");
    //          string caseid=  this.grdNoShow.GetRowValues(i, new string[] { "SZ_case_id" }).ToString();
    //            StringBuilder builder = new StringBuilder();
    //            builder.Append("  <table border='1' width='100%' ><tr>");
    //            //for (int j = 0; j < dsValues.Tables[1].Rows.Count; j++)
    //            //{
    //            //    builder.Append("<td>" + dsValues.Tables[1].Rows[j][0].ToString() + "</td>");
    //            //}

    //            builder.Append("</tr><tr>");
    //            for (int j = 0; j < dsValues.Tables[1].Rows.Count; j++)
    //            {

    //                DataRow[] dr = dsValues.Tables[2].Select("sz_case_id= '"+ caseid + "' and  sz_procedure_group='" + dsValues.Tables[1].Rows[j][0].ToString() + "'");
    //                if (dr != null)
    //                {
    //                    if (dr.Length > 0)
    //                    {
    //                        builder.Append("<td style='width: 30px;'>" + dr[0]["COUNT"].ToString() + "</td>");
    //                    }
    //                    else
    //                    {
    //                        DataRow[] dr1 = dsValues.Tables[3].Select("sz_case_id= '" + caseid + "' and  sz_procedure_group='" + dsValues.Tables[1].Rows[j][0].ToString() + "'");
    //                        if (dr1 == null )
    //                        {
    //                            builder.Append("<td bgcolor='gray' style='width: 30px;'>0 </td>");
    //                        } else
    //                        {
    //                            if (dr1.Length > 0)
    //                            {
    //                                if (dr1[0]["COUNT"].ToString() == "0")
    //                                {
    //                                    builder.Append("<td bgcolor='gray' style='width: 30px;'> </td>");
    //                                }
    //                                else
    //                                {
    //                                    builder.Append("<td style='width: 30px;'>0</td>");
    //                                }
    //                            }
    //                            else
    //                            {
    //                                builder.Append("<td bgcolor='gray' style='width: 30px;'> </td>");
    //                            }
    //                        }
    //                    }
    //                }
    //                else
    //                {
    //                    builder.Append("<td style='width: 30px;'>0</td>");
    //                }
    //            }
    //            builder.Append("</tr> </table>");
    //            lbl.InnerHtml = builder.ToString();

    //        }
    //        ViewState["Dataset"] = dsValues;
    //    }
    //    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());
    //    }

    //}
    public void GetData1()
    {
        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
        {
            ArrayList aList = new ArrayList();
            aList.Add(rblNoshow.SelectedValue.ToString());
            aList.Add(txtCompanyId.Text);
            aList.Add(txtFromDateRange.Text);
            aList.Add(txtToDateRange.Text);
            aList.Add(extddlNoShowProvider.Text);
            aList.Add(extddlNoShowDoctor.Text);
            Bill_Sys_Event_BO objBill_sys_report = new Bill_Sys_Event_BO();
            DataSet           ds = new DataSet();
            ds = objBill_sys_report.GetVisitByType(aList);
            //DataSet ds = (DataSet)ViewState["Dataset"];
            DataTable dt = new DataTable();
            dt.Columns.Add("Case #");
            dt.Columns.Add("Patient Name");
            dt.Columns.Add("DOA");
            dt.Columns.Add("Date Of First Visit");
            dt.Columns.Add("Date Of Last Visit");
            dt.Columns.Add("Case Type");
            dt.Columns.Add("Carrier");

            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                dt.Columns.Add(ds.Tables[1].Rows[i][0].ToString());
            }
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                dr["Case #"] = ds.Tables[0].Rows[i]["SZ_CASE_NO"].ToString();
                //
                dr["Patient Name"]        = " <a target='_self' href='#' onclick=\"showPateintFrame('" + ds.Tables[0].Rows[i]["SZ_case_id"].ToString() + "')\">" + ds.Tables[0].Rows[i]["PatientName"].ToString() + "</a>";
                dr["DOA"]                 = ds.Tables[0].Rows[i]["DT_DATE_OF_ACCIDENT"].ToString();
                dr["Date Of First Visit"] = ds.Tables[0].Rows[i]["FirstVisitDate"].ToString();
                dr["Date Of Last Visit"]  = ds.Tables[0].Rows[i]["LastVisitDate"].ToString();
                dr["Case Type"]           = ds.Tables[0].Rows[i]["SZ_CASE_TYPE_NAME"].ToString();
                dr["Carrier"]             = ds.Tables[0].Rows[i]["SZ_INSURANCE_NAME"].ToString().Replace('\'', ' ');

                for (int j = 0; j < ds.Tables[1].Rows.Count; j++)
                {
                    string    specialty = ds.Tables[1].Rows[j][0].ToString();
                    DataRow[] dr2       = ds.Tables[2].Select("sz_case_id= '" + ds.Tables[0].Rows[i]["SZ_case_id"].ToString() + "' and  sz_procedure_group='" + specialty + "'");
                    if (dr2 != null)
                    {
                        if (dr2.Length > 0)
                        {
                            dr[specialty] = dr2[0]["COUNT"].ToString();
                        }
                        else
                        {
                            DataRow[] dr1 = ds.Tables[3].Select("sz_case_id= '" + ds.Tables[0].Rows[i]["SZ_case_id"].ToString() + "' and  sz_procedure_group='" + specialty + "'");
                            if (dr1 == null)
                            {
                                dr[specialty] = "0";
                            }
                            else
                            {
                                if (dr1.Length > 0)
                                {
                                    if (dr1[0]["COUNT"].ToString() == "0")
                                    {
                                        dr[specialty] = "<span style='bgcolor: #d3d3d3; font - weight:bold'>NA</span>";
                                    }
                                    else
                                    {
                                        dr[specialty] = "0";
                                    }
                                }
                                else
                                {
                                    dr[specialty] = "<span style='bgcolor: #d3d3d3; font - weight:bold'>NA</span>";
                                }
                            }
                        }
                    }
                    else
                    {
                        dr[specialty] = "<span style='bgcolor: #d3d3d3; font - weight:bold'>NA</span>";
                    }
                }
                dt.Rows.Add(dr);
            }
            grdNoShow.DataSource = dt;
            grdNoShow.DataBind();


            ViewState["Dataset"] = ds;
        }
        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());
        }
    }
Example #7
0
    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());
        }
    }
Example #8
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());
        }
    }
Example #9
0
    protected void btnDeletVisit_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
        {
            string str = "";
            for (int i = 0; i < this.grdShowVisit.VisibleRowCount; i++)
            {
                GridViewDataColumn item     = (GridViewDataColumn)this.grdShowVisit.Columns[0];
                CheckBox           checkBox = (CheckBox)this.grdShowVisit.FindRowCellTemplateControl(i, item, "chkSelect");
                if (checkBox.Checked)
                {
                    string[] strArrays = new string[1];
                    strArrays[0] = "I_EVENT_ID";
                    string            str1            = this.grdShowVisit.GetRowValues(i, strArrays).ToString();
                    Bill_Sys_DeleteBO billSysDeleteBO = new Bill_Sys_DeleteBO();
                    if (!billSysDeleteBO.deleteRecord("SP_TXN_CALENDAR_EVENT", "@I_EVENT_ID", str1))
                    {
                        if (str != "")
                        {
                            string[] strArrays1 = new string[1];
                            strArrays1[0] = "DT_EVENT_DATE";
                            str           = string.Concat(str, " , ", this.grdShowVisit.GetRowValues(i, strArrays1).ToString());
                        }
                        else
                        {
                            string[] strArrays2 = new string[1];
                            strArrays2[0] = "DT_EVENT_DATE";
                            str           = this.grdShowVisit.GetRowValues(i, strArrays2).ToString();
                        }
                    }
                }
            }
            Bill_Sys_Event_BO billSysEventBO = new Bill_Sys_Event_BO();
            DataSet           visits         = billSysEventBO.GetVisits(this.txtCasID.Text, this.txtCompanyID.Text);
            this.grdShowVisit.DataSource = visits;
            this.grdShowVisit.DataBind();
            if (str == "")
            {
                this.usrMessage1.PutMessage("visit deleted successfully..");
                this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                this.usrMessage1.Show();
            }
            else
            {
                this.usrMessage1.PutMessage(string.Concat("Eroor  vsits not deleted for ", str, " event dates"));
                this.usrMessage1.SetMessageType(0);
                this.usrMessage1.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());
        }
    }
Example #10
0
    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;
                }
            }
        }
    }
Example #11
0
    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());
        }
    }
    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)
        {
        }
    }