/// <summary> /// 创建保证金订单 /// </summary> /// <param name="model"></param> /// <returns></returns> public override int Create(DsDealerBailOrder model) { var sysNo = Context.Insert <DsDealerBailOrder>("DsDealerBailOrder", model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("SysNo"); return(sysNo); }
/// <summary> /// 更新保证金订单 /// </summary> /// <param name="model"></param> /// <returns></returns> public override int Update(DsDealerBailOrder model) { var row = Context.Update <DsDealerBailOrder>("DsDealerBailOrder", model) .AutoMap(x => x.SysNo) .Execute(); return(row); }
/// <summary> /// 创建保证金订单 /// </summary> /// <param name="model"></param> /// <returns></returns> public abstract int Create(DsDealerBailOrder model);
public JsonResult Audit(int SysNo, int Status) { var result = new Result { Status = false }; try { string IsSellBusiness = ""; result.Status = true; //更新状态 DsDealerBailOrderBo.Instance.UpdateStatus(SysNo, 0, Status); DsDealerBailOrder Model = DsDealerBailOrderBo.Instance.GetModel(SysNo); //更新会员是否为分销商的状态 if (Status == (int)Hyt.Model.WorkflowStatus.StoresStatus.保证金订单状态.待审核) { IsSellBusiness = "0"; Hyt.BLL.CRM.CrCustomerBo.Instance.UpdateIsSellBusiness(Model.CustomerSysNo, IsSellBusiness); } if (Status == (int)Hyt.Model.WorkflowStatus.StoresStatus.保证金订单状态.已审核) { IsSellBusiness = "1"; Hyt.BLL.CRM.CrCustomerBo.Instance.UpdateIsSellBusiness(Model.CustomerSysNo, IsSellBusiness); string OutTradeNo = "DsDealerBailOrder_" + Model.SysNo; int Recharge = BLL.Balance.CrRechargeBo.Instance.IsDealerCrRecharge(Model.CustomerSysNo, OutTradeNo); if (Recharge == 0) { decimal amount = 10; CrRecharge model = new CrRecharge(); model.TradeNo = "RechargeWX_" + DateTime.Now.ToString("yyyyMMddHHmmss"); model.OutTradeNo = "DsDealerBailOrder_" + Model.SysNo; model.CustomerSysNo = Model.CustomerSysNo; model.ReAmount = amount; model.RePaymentName = "保证金返回"; model.RePaymentId = Hyt.Model.SystemPredefined.PaymentType.分销商预存; model.ReAddTime = DateTime.Now; model.ReMark = "分销商审核通过返回:" + amount + "元"; model.State = 1; Hyt.BLL.Balance.CrRechargeBo.Instance.CreateCrRecharge(model); int isb = Hyt.BLL.Balance.CrRechargeBo.Instance.IsExistenceABalance(Model.CustomerSysNo); if (isb == 0) { CrAccountBalance balance = new CrAccountBalance(); balance.CustomerSysNo = Model.CustomerSysNo; balance.AvailableBalance = 10; balance.FrozenBalance = 0M; balance.TolBlance = 10; balance.Remark = ""; balance.State = 0; balance.AddTime = DateTime.Now; Hyt.BLL.Balance.CrRechargeBo.Instance.CreateCrAccountBalance(balance); } else { Hyt.BLL.Balance.CrRechargeBo.Instance.UpdateAccountBalance(amount, Model.CustomerSysNo); } } } if (Status == (int)Hyt.Model.WorkflowStatus.StoresStatus.保证金订单状态.作废) { //插入记录到付款单 FnPaymentVoucher paymentVoucher = new FnPaymentVoucher(); paymentVoucher.Source = 20; paymentVoucher.SourceSysNo = SysNo; paymentVoucher.PayableAmount = Model.Money; paymentVoucher.PaidAmount = 0; paymentVoucher.CustomerSysNo = Model.CustomerSysNo; paymentVoucher.Status = 10; paymentVoucher.Remarks = "保证金作废"; paymentVoucher.CreatedDate = DateTime.Now; paymentVoucher.CreatedBy = CurrentUser.Base.SysNo; paymentVoucher.PayerSysNo = 0; paymentVoucher.PayDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;; paymentVoucher.LastUpdateDate = DateTime.Now; paymentVoucher.LastUpdateBy = CurrentUser.Base.SysNo; paymentVoucher.PaymentType = 0; int vSysNo = FinanceBo.Instance.InsertPaymentVoucher(paymentVoucher); } } catch (Exception ex) { result.Message = ex.Message; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult DealerBailOrderView(int id) { DsDealerBailOrder model = DsDealerBailOrderBo.Instance.GetModel(id); return(View("DealerBailOrderDetail", model)); }
/// <summary> /// 创建保证金订单 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Create(DsDealerBailOrder model) { return(IDsDealerBailOrderDao.Instance.Create(model)); }