protected void btdelete_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
        {
            ArrayList arrtransport = new ArrayList();
            for (int i = 0; i < grdTransport.Items.Count; i++)
            {
                CheckBox chktransport = (CheckBox)grdTransport.Items[i].FindControl("chkDelete");
                if (chktransport.Checked == true)
                {
                    string strtransportid = grdTransport.DataKeys[i].ToString();
                    arrtransport.Add(strtransportid);
                }
            }
            BillSearchDAO _objBillSearchDAO = new BillSearchDAO();
            _objBillSearchDAO.Delete_Trans_Data(arrtransport, txtCompanyID.Text);


            MessageControl1.PutMessage("Delete Successfully ...!");
            MessageControl1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            MessageControl1.Show();

            DataSet ds = new DataSet();
            ds = _objBillSearchDAO.getTransportinfo(txtCaseID.Text, txtCompanyID.Text);
            grdTransport.DataSource = ds;
            grdTransport.DataBind();
            ClearControl_Popup();
        }
        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 btnTransportdelete_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
        {
            ArrayList list = new ArrayList();
            for (int i = 0; i < this.grdTransport.Items.Count; i++)
            {
                CheckBox box = (CheckBox)this.grdTransport.Items[i].FindControl("chkDelete");
                if (box.Checked)
                {
                    string str = this.grdTransport.DataKeys[i].ToString();
                    list.Add(str);
                }
            }
            BillSearchDAO hdao = new BillSearchDAO();
            hdao.Delete_Trans_Data(list, this.txtCompanyID.Text);
            this.usrMessage.PutMessage("Delete 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");
            divTransGrd.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 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 Page_Load(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());
        }
        btndelete.Attributes.Add("onclick", "return confirm_deletetransport();");
        btnsave.Attributes.Add("onclick", "return val_CheckControls();");
        if (!IsPostBack)
        {
            try
            {
                if (Request.QueryString["caseid"] != null && Request.QueryString["cmpid"] != null)
                {
                    txtCaseID.Text    = Request.QueryString["caseid"].ToString();
                    txtCompanyID.Text = Request.QueryString["cmpid"].ToString();
                }

                BindTimeControl();
                BillSearchDAO _BillSearchDAO = new BillSearchDAO();
                DataSet       ds             = new DataSet();
                ds = _BillSearchDAO.getTransportinfo(txtCaseID.Text, txtCompanyID.Text);
                grdTransport.DataSource = ds;
                grdTransport.DataBind();
                extddlTransport.Flag_ID = txtCompanyID.Text;
            }
            catch (Exception ex)
            {
                this.Session["SendPatientToDoctor"] = false;
                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 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.btnAdd.Attributes.Add("onclick", "return Validate()");
         this.btnTransportsave.Attributes.Add("onclick", "return ValidateTrans()");
         this.btnTransportdelete.Attributes.Add("onclick", "return ValidateDelete()");
         this.btnDeletVisit.Attributes.Add("onclick", "return DeleteVisit()");
         string str = this.Session["SendPatientToDoctor"].ToString();
         this.hdEnable.Value = "0";
         if (str.ToLower() != "false")
         {
             this.hdSeting.Value         = "1";
             this.chkAddToDoctor.Visible = true;
             this.chkAddToDoctor.Checked = true;
         }
         else
         {
             this.hdSeting.Value         = "0";
             this.chkAddToDoctor.Visible = false;
         }
         if (base.Request.QueryString["szcaseid"] != null && base.Request.QueryString["szpid"] != null)
         {
             this.txtCasID.Text     = base.Request.QueryString["szcaseid"].ToString();
             this.txtPatientId.Text = base.Request.QueryString["szpid"].ToString();
         }
         this.txtCompanyID.Text              = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
         this.extddlCaseStatus.Flag_ID       = this.txtCompanyID.Text;
         this.extddlVisitType.Flag_ID        = this.txtCompanyID.Text;
         this.extddlCaseType.Flag_ID         = this.txtCompanyID.Text;
         this.extddlInsuranceCompany.Flag_ID = this.txtCompanyID.Text;
         this.extddlTransport.Flag_ID        = this.txtCompanyID.Text;
         this.lblMsg.Visible = false;
         this.BindTimeControl();
         this.BindDoctorList();
         this.BindPatientInfo();
         this.chkTransportation.Attributes.Add("onclick", "return showTrans();");
         BillSearchDAO billSearchDAO = new BillSearchDAO();
         DataSet       transportinfo = billSearchDAO.getTransportinfo(this.txtCasID.Text, this.txtCompanyID.Text);
         this.grdTransport.DataSource = transportinfo;
         this.grdTransport.DataBind();
     }
 }
    protected void btnTransportsave_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());
        }

        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 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 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());
        }
        BillSearchDAO _BillSearchDAO = new BillSearchDAO();

        try
        {
            _BillSearchDAO.GetInsertTransport(extddlTransport.Selected_Text, extddlTransport.Text, txtCompanyID.Text, txtCaseID.Text, txtFromDate.Text, ddlHours.SelectedItem.ToString(), ddlMinutes.SelectedItem.ToString(), ddlTime.SelectedItem.ToString());
            MessageControl1.PutMessage("Save Successfully ...!");
            MessageControl1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            MessageControl1.Show();
            ClearControl_Popup();

            DataSet ds = new DataSet();
            ds = _BillSearchDAO.getTransportinfo(txtCaseID.Text, txtCompanyID.Text);
            grdTransport.DataSource = ds;
            grdTransport.DataBind();
        }
        catch (Exception ex)
        {
            this.Session["SendPatientToDoctor"] = false;
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string 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());
        }
    }