internal static GCInfo GetInfoById(int innerid) { GCInfo info = new GCInfo(); DataTable dt = SQLHelper.ExecuteDataTable("select * from T_gc where id = @id", innerid); info.Id = innerid; info.BeginTime = Convert.ToDateTime(dt.Rows[0]["begintime"].ToString()); info.EndTime = Convert.ToDateTime(dt.Rows[0]["endtime"].ToString()); info.Reason = dt.Rows[0]["reason"].ToString(); return(info); }
internal static int UpdateInfo(GCInfo gcinfo, int id) { object obj = SQLHelper.ExecuteNonQuery("update T_gc set begintime=@begintime, endtime=@endtime, reason=@reason, where id=@id", gcinfo.BeginTime, gcinfo.EndTime, gcinfo.Reason, id); return(Convert.ToInt32(obj)); }
internal static int AddInfo(GCInfo gcinfo) { object obj = SQLHelper.ExecuteScalar("insert into T_gc(begintime, endtime, reason) output inserted.id values(@begintime, @endtime, @reason)", gcinfo.BeginTime, gcinfo.EndTime, gcinfo.Reason); return(Convert.ToInt32(obj)); }