コード例 #1
0
    protected void btnUpdateStatus_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Bill_Sys_ReportBO billSysReportBO = new Bill_Sys_ReportBO();

        try
        {
            if (this.drdUpdateStatus.Text != "NA")
            {
                ArrayList arrayLists = new ArrayList();
                string    str        = "";
                bool      flag       = false;
                for (int i = 0; i < this.grdBalanceBill.Rows.Count; i++)
                {
                    if (((CheckBox)this.grdBalanceBill.Rows[i].FindControl("chkSelect")).Checked)
                    {
                        if (flag)
                        {
                            str = string.Concat(str, ",'", this.grdBalanceBill.DataKeys[i]["SZ_BILL_NUMBER"].ToString(), "'");
                        }
                        else
                        {
                            str  = string.Concat("'", this.grdBalanceBill.DataKeys[i]["SZ_BILL_NUMBER"].ToString(), "'");
                            flag = true;
                        }
                    }
                }

                if (str != "")
                {
                    arrayLists.Add(this.drdUpdateStatus.Text);
                    arrayLists.Add(str);
                    arrayLists.Add(((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    arrayLists.Add(DateTime.Today.ToShortDateString());
                    arrayLists.Add(((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    billSysReportBO.updateBillStatus(arrayLists);
                    this.usrMessage.PutMessage("Bill status updated successfully.");
                    this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                    this.usrMessage.Show();

                    this.txtBillStatusID.Text = this.extddlBillStatus.Text;
                    BindGrid();
                }
            }
        }
        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());
        }
    }
コード例 #2
0
    protected void btnUpdateStatus_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
        {
            if (extddlBillStatus.Text != "NA")
            {
                _reportBO = new Bill_Sys_ReportBO();
                ArrayList objAL           = new ArrayList();
                string    szListOfBillIDs = "";
                Boolean   flag            = false;
                for (int i = 0; i < grdBillReportDetails.Items.Count; i++)
                {
                    CheckBox chkDelete1 = (CheckBox)grdBillReportDetails.Items[i].FindControl("chkUpdateStatus");
                    if (chkDelete1.Checked)
                    {
                        if (flag == false)
                        {
                            szListOfBillIDs = "'" + grdBillReportDetails.Items[i].Cells[5].Text + "'";
                            flag            = true;
                        }
                        else
                        {
                            szListOfBillIDs = szListOfBillIDs + ",'" + grdBillReportDetails.Items[i].Cells[5].Text + "'";
                        }
                    }
                }
                if (szListOfBillIDs != "")
                {
                    objAL.Add(extddlBillStatus.Text);
                    objAL.Add(szListOfBillIDs);
                    objAL.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    objAL.Add(txtBillStatusdate.Text);
                    objAL.Add(((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID);
                    _reportBO.updateBillStatus(objAL);
                    usrMessage.PutMessage("Bill status updated successfully.");
                    usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                    usrMessage.Show();

                    BindGrid();
                }
            }
        }
        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());
        }
    }