/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add(Sys_AccountRep model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Sys_AccountRep("); strSql.Append("accid,statTime,endtime,insertTime,Browser"); strSql.Append(") values ("); strSql.Append("@accid,@statTime,@endtime,@insertTime,@Browser"); 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 bool Update(Sys_AccountRep model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Sys_AccountRep set "); strSql.Append(" accid = @accid , "); strSql.Append(" statTime = @statTime , "); strSql.Append(" endtime = @endtime , "); strSql.Append(" insertTime = @insertTime , "); strSql.Append(" Browser = @Browser "); strSql.Append(" where id=@id "); int row = DapperHelper.Execute(strSql.ToString(), model); if (row > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public static bool Update(Sys_AccountRep model) { Sys_AccountRepBaseDAL dal = new Sys_AccountRepBaseDAL(); return(dal.Update(model)); }
/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public static int Add(Sys_AccountRep model) { Sys_AccountRepBaseDAL dal = new Sys_AccountRepBaseDAL(); return(dal.Add(model)); }