/// <summary> /// 更新一条数据 /// </summary> public bool Update(SysRpt_ShopActive model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update SysRpt_ShopActive set "); strSql.Append(" accid = @accid , "); strSql.Append(" AgentId = @AgentId , "); strSql.Append(" regTime = @regTime , "); strSql.Append(" active = @active , "); strSql.Append(" maxactive = @maxactive , "); strSql.Append(" lastNum = @lastNum , "); strSql.Append(" startTime = @startTime , "); strSql.Append(" updatetime = @updatetime , "); strSql.Append(" Remark = @Remark , "); strSql.Append(" firstID = @firstID , "); strSql.Append(" stateVal = @stateVal "); strSql.Append(" where id=@id "); int row = DapperHelper.Execute(strSql.ToString(), model); if (row > 0) { return(true); } else { return(false); } }
/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add(SysRpt_ShopActive model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into SysRpt_ShopActive("); strSql.Append("accid,AgentId,regTime,active,maxactive,lastNum,startTime,updatetime,Remark,firstID,stateVal"); strSql.Append(") values ("); strSql.Append("@accid,@AgentId,@regTime,@active,@maxactive,@lastNum,@startTime,@updatetime,@Remark,@firstID,@stateVal"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); object obj = DapperHelper.ExecuteScalar(strSql.ToString(), model); if (obj != null) { return(Convert.ToInt32(obj)); } else { return(0); } }
/// <summary> /// 更新一条数据 /// </summary> public static bool Update(SysRpt_ShopActive model) { SysRpt_ShopActiveBaseDAL dal = new SysRpt_ShopActiveBaseDAL(); return(dal.Update(model)); }
/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public static int Add(SysRpt_ShopActive model) { SysRpt_ShopActiveBaseDAL dal = new SysRpt_ShopActiveBaseDAL(); return(dal.Add(model)); }