Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }