Example #1
0
 public bool addPayment(Payment p)
 {
     if (p.verify == true)
     {
         Payment.Add(p);
         return(true);
     }
     return(false);
 }
Example #2
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         PaymentInfo paymentInfo = new PaymentInfo();
         if (base.IsEdit)
         {
             paymentInfo = Payment.GetDataById(base.OpID);
         }
         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
         string[] array = base.Request.Form["p-key"].Split(new char[]
         {
             ','
         });
         string[] array2 = base.Request.Form["p-value"].Split(new char[]
         {
             ','
         });
         for (int i = 0; i < array.Length; i++)
         {
             if (!string.IsNullOrEmpty(array[i]))
             {
                 stringBuilder.Append(array[i] + ":\"" + array2[i] + "\",");
             }
         }
         paymentInfo.ParametersValue = "{" + stringBuilder.ToString().Trim().TrimEnd(new char[]
         {
             ','
         }) + "}";
         if (base.Action.Equals(ActionType.Add.ToString()))
         {
             paymentInfo.PayCode       = this.DropDownList1.SelectedValue;
             paymentInfo.AutoTimeStamp = System.DateTime.Now;
             if (Payment.Exists(paymentInfo.PayCode))
             {
                 base.ShowMsg("支付方式已存在!");
             }
             else if (Payment.Add(paymentInfo) > 0)
             {
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加支付[" + paymentInfo.DisplayName + "] thành công");
                 base.Response.Redirect(string.Concat(new object[]
                 {
                     "PaymentSet.aspx?CatalogID=",
                     base.CurrentCatalogID,
                     "&Module=",
                     base.CurrentModuleCode,
                     "&action=View"
                 }));
             }
             else
             {
                 base.ShowMsg("Thao tác thất bại");
             }
         }
         if (base.Action.Equals(ActionType.Modify.ToString()))
         {
             if (Payment.Update(paymentInfo))
             {
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改支付[" + paymentInfo.DisplayName + "] thành công");
                 base.Response.Redirect(string.Concat(new object[]
                 {
                     "PaymentSet.aspx?CatalogID=",
                     base.CurrentCatalogID,
                     "&Module=",
                     base.CurrentModuleCode,
                     "&action=View"
                 }));
             }
             else
             {
                 base.ShowMsg("Thao tác thất bại");
             }
         }
     }
 }
Example #3
0
 public ActionResult Add(Payment u)
 {
     u.Add();
     return(View());
 }
 public ActionResult Add(Payment b)
 {
     b.Add();
     return(View());
 }