示例#1
0
        protected void PaymentMethodDDl_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PaymentMethodDDl.SelectedValue.ToString() == "Cash")
            {
                cashRow.Visible       = true;
                ccGridViewRow.Visible = false;
                ccDetail.Visible      = false;
            }
            else
            {
                cashRow.Visible       = false;
                ccGridViewRow.Visible = true;

                _pmb._CustomerId = _pmb._Id;
                _pmb._Top        = 1;
                _pmb._Flag       = "C";
                _pmb._PageSize   = 1000;

                _pmb.Execute("SelectCustomer_CreditCardByCustomerIdCapability");
                if (_pmb.Success != null)
                {
                    CreditCardDT = (DataTable)_pmb.Success;
                    for (int i = 0; i < CreditCardDT.Rows.Count; i++)
                    {
                        string        n  = CreditCardDT.Rows[i]["CCNumber"].ToString().TrimEnd();
                        StringBuilder sb = new StringBuilder(n);
                        for (int j = 0; j < sb.Length; j++)
                        {
                            if (j >= 0 && j <= 11)
                            {
                                sb[j] = 'X';
                            }
                        }
                        n = sb.ToString();
                        CreditCardDT.Rows[i]["CCNumber"] = n;
                    }
                    CreditCardGV.DataSource = CreditCardDT;
                    CreditCardGV.DataBind();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }
                }

                _pmb.Execute("SelectCustomer_CreditCardByCustomerIdCapability");
                if (_pmb.Success != null)
                {
                    creditCardDT = (DataTable)_pmb.Success;
                    if (creditCardDT.Rows.Count > 0)
                    {
                        CreditCardGV.DataSource = creditCardDT;
                        CreditCardGV.DataBind();
                    }
                    else
                    {
                        CreditCardtable.Visible = true;
                        Addbtn.Visible          = false;
                    }
                }
            }
            catch (Exception)
            {
            }
        }