/// <summary> /// 插入数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>新增记录编号</returns> /// <remarks>2015-08-21 王耀发 创建</remarks> public override int Insert(LgFreightModule entity) { entity.SysNo = Context.Insert("LgFreightModule", entity) .AutoMap(o => o.SysNo) .ExecuteReturnLastId <int>("SysNo"); return(entity.SysNo); }
/// <summary> /// 更新数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>修改记录编号</returns> /// <remarks>2015-08-21 王耀发 创建</remarks> public override int Update(LgFreightModule entity) { return(Context.Update("LgFreightModule", entity) .AutoMap(o => o.SysNo) .Where("SysNo", entity.SysNo) .Execute()); }
/// <summary> /// 保存运费模板 /// </summary> /// <param name="model">运费模板</param> /// <param name="user">操作人</param> /// <returns></returns> /// <remarks>2015-08-06 王耀发 创建</remarks> public Result SaveFreightModule(LgFreightModule model, SyUser user) { Result r = new Result() { Status = false }; if (model.SysNo > 0) { //Hyt.DataAccess.Logistics.IFreightModuleDetailsDao.Instance.DeleteByFreightModuleSysNo(model.SysNo); //修改数据 LgFreightModule entity = Hyt.DataAccess.Logistics.ILgFreightModuleDao.Instance.GetEntity(model.SysNo); model.Status = entity.Status; model.AuditDate = entity.AuditDate; model.CreatedDate = entity.CreatedDate; model.CreatedBy = entity.CreatedBy; model.LastUpdateBy = user.SysNo; model.LastUpdateDate = DateTime.Now; Hyt.DataAccess.Logistics.ILgFreightModuleDao.Instance.Update(model); r.StatusCode = model.SysNo; r.Status = true; } else { //新增数据 model.Status = (int)Hyt.Model.WorkflowStatus.LogisticsStatus.运费模板状态.待审核; model.AuditDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue; model.CreatedDate = DateTime.Now; model.CreatedBy = user.SysNo; model.LastUpdateBy = user.SysNo; model.LastUpdateDate = DateTime.Now; r.StatusCode = Hyt.DataAccess.Logistics.ILgFreightModuleDao.Instance.Insert(model); r.Status = true; } return(r); }
/// <summary> /// 更新数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>修改记录编号</returns> /// <remarks>2015-08-21 王耀发 创建</remarks> public abstract int Update(LgFreightModule entity);
/// <summary> /// 插入数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>新增记录编号</returns> /// <remarks>2015-08-06 王耀发 创建</remarks> public abstract int Insert(LgFreightModule entity);