/// <summary> /// 修改数据 /// </summary> /// <param name="model">实体</param> /// <returns>影响行数</returns> public int Update(FnTradeLog model) { return(DBContext.Update(StrTableName, model) .AutoMap(x => x.SysNo) .Where(x => x.SysNo) .Execute()); }
/// <summary> /// 修改数据 /// </summary> /// <param name="model">实体</param> /// <returns>影响行数</returns> public JResult Update(FnTradeLog model) { var result = new JResult(); try { var row = Using <IFnTradeLog>().Update(model); if (row <= 0) { throw new Exception("修改数据失败"); } result.Status = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }
/// <summary> /// 新增数据 /// </summary> /// <param name="model">实体</param> /// <returns>系统编号</returns> public JResult <int> Insert(FnTradeLog model) { var result = new JResult <int>(); try { var row = Using <IFnTradeLog>().Insert(model); if (row <= 0) { throw new Exception("添加数据失败"); } result.Status = true; result.Data = row; } catch (Exception ex) { result.Message = ex.Message; } return(result); }
/// <summary> /// 新增数据 /// </summary> /// <param name="model">实体</param> /// <returns>系统编号</returns> public int Insert(FnTradeLog model) { return(DBContext.Insert(StrTableName, model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("SysNo")); }