/// <summary> /// 保存仓库免邮费 /// </summary> /// <param name="model">仓库免邮费</param> /// <param name="user">操作人</param> /// <returns></returns> /// <remarks>2016-04-20 王耀发 创建</remarks> public Result SaveWhouseFreightFree(WhouseFreightFree model, SyUser user) { Result r = new Result(); try { if (model.SysNo > 0) { WhouseFreightFree Entity = IWhouseFreightFreeDao.Instance.GetEntity(model.SysNo); model.CreatedBy = Entity.CreatedBy; model.CreatedDate = Entity.CreatedDate; model.LastUpdateBy = user.SysNo; model.LastUpdateDate = DateTime.Now; IWhouseFreightFreeDao.Instance.Update(model); r.Status = true; r.Message = "操作成功"; } else { model.CreatedBy = user.SysNo; model.CreatedDate = DateTime.Now; model.LastUpdateBy = user.SysNo; model.LastUpdateDate = DateTime.Now; IWhouseFreightFreeDao.Instance.Insert(model); r.Status = true; r.Message = "操作成功"; } } catch (Exception ex) { r.Status = false; r.Message = ex.Message; } return(r); }
/// <summary> /// 更新数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>修改记录编号</returns> /// <remarks>2016-04-20 王耀发 创建</remarks> public override int Update(WhouseFreightFree entity) { return(Context.Update("WhouseFreightFree", entity) .AutoMap(o => o.SysNo) .Where("SysNo", entity.SysNo) .Execute()); }
/// <summary> /// 插入数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>新增记录编号</returns> /// <remarks>2016-04-20 王耀发 创建</remarks> public override int Insert(WhouseFreightFree entity) { entity.SysNo = Context.Insert("WhouseFreightFree", entity) .AutoMap(o => o.SysNo) .ExecuteReturnLastId <int>("SysNo"); return(entity.SysNo); }
/// <summary> /// 更新数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>修改记录编号</returns> /// <remarks>2016-04-20 王耀发 创建</remarks> public abstract int Update(WhouseFreightFree entity);
/// <summary> /// 插入数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>新增记录编号</returns> /// <remarks>2016-04-20 王耀发 创建</remarks> public abstract int Insert(WhouseFreightFree entity);