/// <summary> /// 修改代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-15 刘伟豪 创建 </remarks> public override bool Update(DsAgent model) { int rows = Context.Update("DsAgent", model) .AutoMap(x => x.SysNo, x => x.CreatedDate, x => x.CreatedBy) .Where(x => x.SysNo) .Execute(); return(rows > 0); }
/// <summary> /// 修改代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-15 刘伟豪 创建 </remarks> public bool Update(DsAgent model) { bool r = IDsAgentDao.Instance.Update(model); if (r) { SyUserBo.Instance.UpdateSyUserStatus(model.UserSysNo, model.Status); UpdateDealersLevel(model.UserSysNo, model.LevelSysNo); Log.SysLog.Instance.Info(LogStatus.系统日志来源.后台, "修改代理商", LogStatus.系统日志目标类型.代理商, model.SysNo); } return(r); }
/// <summary> /// 新建代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-14 刘伟豪 创建 </remarks> public int Create(DsAgent model) { var sysNo = IDsAgentDao.Instance.Create(model); if (sysNo <= 0) { return(sysNo); //未成功直接返回 } Log.SysLog.Instance.Info(LogStatus.系统日志来源.后台, "创建代理商", LogStatus.系统日志目标类型.代理商, sysNo); var modelPre = new DsAgentPrePayment //金额自动初始化为0 { CreatedBy = model.CreatedBy, CreatedDate = model.CreatedDate, AgentSysNo = sysNo, LastUpdateBy = model.LastUpdateBy, LastUpdateDate = model.LastUpdateDate }; DsAgentPrePaymentBo.Instance.Create(modelPre); return(sysNo);//成功则创建代理商预存款后 返回新加的系统编号 }
/// <summary> /// 修改代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-15 刘伟豪 创建 </remarks> public abstract bool Update(DsAgent model);
/// <summary> /// 新建代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-14 刘伟豪 创建 </remarks> public abstract int Create(DsAgent model);
/// <summary> /// 新建代理商 /// </summary> /// <param name="model">代理商实体</param> /// <remarks> 2016-04-14 刘伟豪 创建 </remarks> public override int Create(DsAgent model) { return(Context.Insert("DsAgent", model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("SysNo")); }