Esempio n. 1
0
    protected void btnSaveDesc_Click(object sender, EventArgs e)
    {
        try
        {
            Bill_Sys_BillTransaction_BO n_bo;
            Bill_Sys_Verification_Desc  desc;
            bool      flag        = false;
            bool      flag2       = false;
            string    statusCode  = "";
            ArrayList list        = new ArrayList();
            ArrayList list2       = new ArrayList();
            ArrayList list3       = new ArrayList();
            ArrayList listReasons = new ArrayList();

            this.ViewState["Process"] = "";
            this.ViewState["Process"] = "EOR";
            ArrayList list4       = new ArrayList();
            ArrayList list5       = new ArrayList();
            string    specialty   = "";
            string[]  sBillNumber = System.Text.RegularExpressions.Regex.Split(hdnBillNumber.Value.ToString(), @"\,");
            for (int j = 0; j < sBillNumber.Length; j++)
            {
                if (!string.IsNullOrEmpty(hfEORReason.Value))
                {
                    listReasons.AddRange(hfEORReason.Value.TrimEnd(',').Split(','));
                }
                string sBillNo = sBillNumber[j].ToString(); // bill no
                specialty = hdnSpecialty.Value.ToString();  //Specialty
                list2.Add(txtCaseID.Text);
                list5.Add(sBillNo);
                list3.Add(specialty);
                desc = new Bill_Sys_Verification_Desc();
                desc._sz_verification_reasons = listReasons.ToString();
                desc.sz_bill_no           = sBillNo;
                desc.sz_description       = this.txtSaveDescription.Text;
                desc.sz_verification_date = this.txtSaveDate.Text;
                desc.i_verification       = 4;
                desc.sz_company_id        = this.txtCompanyID.Text;
                desc.sz_user_id           = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString();
                desc.sz_flag = "EOR";
                list4.Add(desc);
                flag = true;
            }

            this._objUploadFile                  = new Bill_Sys_UploadFile();
            this._objUploadFile.sz_bill_no       = list5;
            this._objUploadFile.sz_company_id    = this.txtCompanyID.Text;
            this._objUploadFile.sz_flag          = "EOR";
            this._objUploadFile.sz_case_id       = list2;
            this._objUploadFile.sz_speciality_id = list3;

            if (flag)
            {
                n_bo       = new Bill_Sys_BillTransaction_BO();
                statusCode = n_bo.InsertUpdateBillStatus(list4);
                this._objUploadFile.sz_StatusCode = statusCode;
                this.ViewState["VSUpload"]        = this._objUploadFile;
                list  = n_bo.Get_Node_Type(list4);
                flag2 = true;
                if (statusCode != "")
                {
                    DataTable eorReasonsWithBill = new DataTable();
                    eorReasonsWithBill.Columns.Add("verificationReasonIds");
                    eorReasonsWithBill.Columns.Add("billNumber");
                    foreach (string billNo in sBillNumber)
                    {
                        foreach (string eorId in listReasons)
                        {
                            eorReasonsWithBill.Rows.Add(eorId, billNo);
                        }
                    }
                    n_bo.UpdateEORReason(statusCode, eorReasonsWithBill);
                }
                if (list.Contains("NFVER"))
                {
                    list.Clear();
                    list.Add("NFVER");
                    this.Session["NODETYPE"] = list;
                }
                else
                {
                    this.Session["NODETYPE"] = list;
                }
            }

            if (!statusCode.Equals("") && flag2)
            {
                lblMessage.Visible  = true;
                lblMessage.Text     = "Record saved successfully";
                hdnStatusCode.Value = statusCode;
            }
            HtmlAnchor anchorScan = (HtmlAnchor)this.FindControl("anchorScan");
            anchorScan.Visible = true;
            BindGrid();
            lblScan.Visible   = true;
            lblScan.InnerText = "[Scan/Upload here to add the same document against all selected bills]";
        }
        catch (Exception ex)
        {
            lblErrorMessage.Visible = true;
            lblErrorMessage.Text    = ex.Message.ToString();
        }
    }