Esempio n. 1
0
    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());
        }

        chkPatientReturnToWorkWithoutLimitation.Attributes.Add("onclick", "checkvalidate_b();");
        chkPatientcannotReturn.Attributes.Add("onclick", "checkvalidate_a();");
        chkPatientReturnToWorkWithlimitation.Attributes.Add("onclick", "checkvalidate_c();");
        chklstPatientLimitationAllReason.Attributes.Add("onclick", "checkvalidate_b();");

        try
        {
            if (Session["TEMPLATE_BILL_NO"] != null)
            {
                txtBillNumber.Text = Session["TEMPLATE_BILL_NO"].ToString(); //"sas0000001";
            }
            txtCompanyID.Text = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            //TreeMenuControl1.ROLE_ID = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ROLE;


            if (!IsPostBack)
            {
                _workerstemplate         = new workers_templateC4_2();
                _billingCompanyDetailsBO = new Bill_Sys_BillingCompanyDetails_BO();
                txtPatientID.Text        = _billingCompanyDetailsBO.GetInsuranceCompanyID(txtBillNumber.Text, "SP_MST_PATIENT_INFORMATION", "GETPATIENTID");
                txtWorkStatusID.Text     = _workerstemplate.GetWorkStatusLatestID(txtBillNumber.Text);
                LoadData();
                LoadOtherInformation();
            }
        }
        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);
        }
        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("ReturnToWorkC4_2.aspx");
        }
        #endregion
        //Method End

        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    private void SaveData()
    {
        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());
        }
        _saveOperation = new SaveOperation();
        _editOperation = new EditOperation();

        _workerstemplate = new workers_templateC4_2();
        try
        {
            if (txtWorkStatusID.Text != "")
            {
                if (chkPatientcannotReturn.Checked == false && chkPatientReturnToWorkWithlimitation.Checked == false && chkPatientReturnToWorkWithoutLimitation.Checked == false)
                {
                    hdntxtPatientCanReturnWork.Text     = "5";
                    txtPatientWorkWithLimitaion.Text    = "";
                    txtPatientWorkWithoutLimitaion.Text = "";
                    txtQuantifyTheLimitaion.Text        = "";
                    txtOtherLimitation.Text             = "";
                    _editOperation.Xml_File             = "WorkStatusC4_2.xml";
                    _editOperation.WebPage       = this.Page;
                    _editOperation.Primary_Value = txtWorkStatusID.Text;
                    _editOperation.UpdateMethod();
                }

                else
                {
                    if (chkPatientcannotReturn.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "0";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientcannotReturn.Text;
                    }
                    if (chkPatientReturnToWorkWithoutLimitation.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "1";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientWorkWithoutLimitaion.Text;
                    }
                    else if (chkPatientReturnToWorkWithlimitation.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "2";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientWorkWithLimitaion.Text;
                    }
                    //rdlstWorkRestriction
                    _editOperation.Xml_File      = "WorkStatusC4_2.xml";
                    _editOperation.WebPage       = this.Page;
                    _editOperation.Primary_Value = txtWorkStatusID.Text;
                    _editOperation.UpdateMethod();
                }
            }
            else
            {
                if (chkPatientcannotReturn.Checked == false && chkPatientReturnToWorkWithlimitation.Checked == false && chkPatientReturnToWorkWithoutLimitation.Checked == false)
                {
                    hdntxtPatientCanReturnWork.Text     = "5";
                    txtPatientWorkWithLimitaion.Text    = "";
                    txtPatientWorkWithoutLimitaion.Text = "";
                    txtQuantifyTheLimitaion.Text        = "";
                    txtOtherLimitation.Text             = "";
                    _saveOperation.WebPage  = this.Page;
                    _saveOperation.Xml_File = "WorkStatusC4_2.xml";
                    _saveOperation.SaveMethod();
                    txtWorkStatusID.Text = _workerstemplate.GetWorkStatusLatestID(txtBillNumber.Text);
                }
                else
                {
                    if (chkPatientcannotReturn.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "0";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientcannotReturn.Text;
                    }
                    if (chkPatientReturnToWorkWithoutLimitation.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "1";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientWorkWithoutLimitaion.Text;
                    }
                    else if (chkPatientReturnToWorkWithlimitation.Checked)
                    {
                        hdntxtPatientCanReturnWork.Text            = "2";
                        hdntxtPatientCanReturnWorkDescription.Text = txtPatientWorkWithLimitaion.Text;
                    }
                    if (rdlstWorkRestriction.SelectedValue != "1")
                    {
                        txtDescribeWorkRestriction.Text = "";
                    }
                    _saveOperation.WebPage  = this.Page;
                    _saveOperation.Xml_File = "WorkStatusC4_2.xml";
                    _saveOperation.SaveMethod();
                    txtWorkStatusID.Text = _workerstemplate.GetWorkStatusLatestID(txtBillNumber.Text);
                }
            }
        }
        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());
        }
    }