Beispiel #1
0
 protected void BtnOrder_Click(object sender, EventArgs e)
 {
     if (TxtOrdName.Text.Length < 1)
     {
         showErrorMwssage(1003);
     }
     else if (TxtOrdEmail.Text.Length < 1)
     {
         showErrorMwssage(1004);
     }
     else
     {
         string cardId;
         if (hdnCard.Value == "-1")
         {
             person person = new person();
             person = (person)Session["person"];
             creaditCardBLL creaditCard = new creaditCardBLL()
             {
                 id         = GlobFuncs.createCreditCardId(),
                 number     = TxtCard.Text.ToString(),
                 month      = monthDdl.SelectedValue.ToString(),
                 year       = YearDdl.SelectedValue.ToString(),
                 digitNo    = TxtCvv.Text.ToString(),
                 ownerId    = TxtId.Text.ToString(),
                 customerId = person.CustomId
             };
             cardId = creaditCard.AddCard();
         }
         else
         {
             cardId = hdnCard.Value;
         }
         Session["selectedExt"] = hdnSelectedExt.Value;
         Session["totPrice"]    = hdnPrice.Value;
         Session["notes"]       = txtNotes.Text;
         if (BtnOrder.Text != "שמור שינויים")
         {
             Response.Redirect("OrderConfirmation.aspx?Company=" + Company + "&CarId=" + Car + "&card=" + cardId);
         }
         else
         {
             Response.Redirect("OrderConfirmation.aspx?Company=" + Company + "&CarId=" + Car + "&card=" + cardId + "&id=" + Request["id"]);
         }
     }
 }
Beispiel #2
0
 //מתודה השומרת פרטי כרטיס אשראי חדשים
 protected void addCreditCard_Click(object sender, EventArgs e)
 {
     if (txtCradNumber.Text == "")
     {
         showErrorMwssage(1005);
     }
     else if (txtCardMonth.Text == "")
     {
         showErrorMwssage(2002);
     }
     else if (txtCardYear.Text == "")
     {
         showErrorMwssage(2003);
     }
     else if (txtCardCvv.Text == "")
     {
         showErrorMwssage(2004);
     }
     else if (txtOwnerId.Text == "")
     {
         showErrorMwssage(2005);
     }
     else
     {
         person per = new person();
         per = (person)Session["person"];
         creaditCardBLL creaditCard = new creaditCardBLL()
         {
             id         = GlobFuncs.createCreditCardId(),
             number     = txtCradNumber.Text,
             month      = txtCardMonth.Text,
             year       = txtCardYear.Text,
             digitNo    = txtCardCvv.Text,
             ownerId    = txtOwnerId.Text,
             customerId = per.CustomId
         };
         string txtCardId = creaditCard.AddCard();
         rptCards.DataSource = creaditCard.getCards();
         rptCards.DataBind();
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "hideModal", "hideAddCreditCardModal()", true);
         Response.Redirect("PrivateArea.aspx#CreditCards");
     }
 }
 public string Post(creaditCardBLL creditCard)
 {
     creditCard.id = GlobFuncs.createCreditCardId();
     return(creditCard.AddCard());
 }