Пример #1
0
        //מתודה השומרת עדכון פרטים לכרטיסי אשראי
        protected void btnEditCreditCard_Click(object sender, EventArgs e)
        {
            Button bt  = (Button)sender;
            person per = new person();

            per = (person)Session["person"];
            RepeaterItem repeaterItem     = (RepeaterItem)((Control)sender).NamingContainer;
            var          txteEitNumber    = repeaterItem.FindControl("txtEditCardNumber") as TextBox;
            var          txtEditCardMonth = repeaterItem.FindControl("txtEditCardMonth") as TextBox;
            var          txtEditYear      = repeaterItem.FindControl("txtEditYear") as TextBox;
            var          txtEditCardCvv   = repeaterItem.FindControl("txtEditCardCvv") as TextBox;

            creaditCardBLL creaditCardBLL = new creaditCardBLL()
            {
                id         = bt.CommandArgument,
                customerId = per.CustomId
            };

            creaditCardBLL.getCardDetails(bt.CommandArgument);
            if (txteEitNumber.Text != "")
            {
                creaditCardBLL.number = txteEitNumber.Text;
            }
            if (txtEditCardMonth.Text != "")
            {
                creaditCardBLL.month = txtEditCardMonth.Text;
            }
            if (txtEditYear.Text != "")
            {
                creaditCardBLL.year = txtEditYear.Text;
            }
            if (txtEditCardCvv.Text != null)
            {
                creaditCardBLL.digitNo = txtEditCardCvv.Text;
            }
            int ret = creaditCardBLL.updateCard();

            if (ret == 1)
            {
                Response.Redirect(Request.RawUrl);
            }
        }