Ejemplo n.º 1
0
 public Maticsoft.Model.Pay.RechargeRequest DataRowToModel(DataRow row)
 {
     Maticsoft.Model.Pay.RechargeRequest request = new Maticsoft.Model.Pay.RechargeRequest();
     if (row != null)
     {
         if ((row["RechargeId"] != null) && (row["RechargeId"].ToString() != ""))
         {
             request.RechargeId = long.Parse(row["RechargeId"].ToString());
         }
         if ((row["TradeDate"] != null) && (row["TradeDate"].ToString() != ""))
         {
             request.TradeDate = DateTime.Parse(row["TradeDate"].ToString());
         }
         if ((row["RechargeBlance"] != null) && (row["RechargeBlance"].ToString() != ""))
         {
             request.RechargeBlance = decimal.Parse(row["RechargeBlance"].ToString());
         }
         if ((row["UserId"] != null) && (row["UserId"].ToString() != ""))
         {
             request.UserId = int.Parse(row["UserId"].ToString());
         }
         if ((row["SellerId"] != null) && (row["SellerId"].ToString() != ""))
         {
             request.SellerId = new int?(int.Parse(row["SellerId"].ToString()));
         }
         if ((row["Status"] != null) && (row["Status"].ToString() != ""))
         {
             request.Status = int.Parse(row["Status"].ToString());
         }
         if ((row["Tradetype"] != null) && (row["Tradetype"].ToString() != ""))
         {
             request.Tradetype = new int?(int.Parse(row["Tradetype"].ToString()));
         }
         if ((row["PaymentTypeId"] != null) && (row["PaymentTypeId"].ToString() != ""))
         {
             request.PaymentTypeId = int.Parse(row["PaymentTypeId"].ToString());
         }
         if (row["PaymentGateway"] != null)
         {
             request.PaymentGateway = row["PaymentGateway"].ToString();
         }
     }
     return request;
 }
Ejemplo n.º 2
0
 public ActionResult AjaxRecharge(FormCollection Fm)
 {
     if (!string.IsNullOrWhiteSpace(Fm["rechargmoney"]) && !string.IsNullOrWhiteSpace(Fm["payid"]))
     {
         int modeId = Globals.SafeInt(Fm["payid"], 0);
         decimal num2 = Globals.SafeDecimal(Fm["rechargmoney"], (decimal) 0M);
         if ((modeId > 0) && (num2 > 0M))
         {
             Maticsoft.Model.Pay.RechargeRequest model = new Maticsoft.Model.Pay.RechargeRequest();
             PaymentModeInfo paymentModeById = PaymentModeManage.GetPaymentModeById(modeId);
             if (paymentModeById == null)
             {
                 return base.Content("No");
             }
             model.PaymentGateway = paymentModeById.Gateway;
             model.PaymentTypeId = modeId;
             model.RechargeBlance = num2;
             model.Status = 0;
             model.TradeDate = DateTime.Now;
             model.Tradetype = 1;
             model.UserId = base.CurrentUser.UserID;
             long num3 = this.rechargeBll.Add(model);
             if (num3 > 0L)
             {
                 return base.Content(num3.ToString());
             }
         }
     }
     return base.Content("No");
 }