internal static QJInfo GetInfoById(int innerid) { QJInfo info = new QJInfo(); DataTable dt = SQLHelper.ExecuteDataTable("select * from T_qj 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.TotalTime = Convert.ToDouble(dt.Rows[0]["totaltime"]); info.Reason = dt.Rows[0]["reason"].ToString(); info.TypeId = Convert.ToInt32(dt.Rows[0]["typeid"]); return(info); }
internal static int UpdateInfo(QJInfo qjinfo, int id) { object obj = SQLHelper.ExecuteNonQuery("update T_qj set begintime=@begintime, endtime=@endtime, totaltime=@totaltime, reason=@reason, typeid=@typeid where id=@id", qjinfo.BeginTime, qjinfo.EndTime, qjinfo.TotalTime, qjinfo.Reason, qjinfo.TypeId, id); return(Convert.ToInt32(obj)); }
internal static int AddInfo(QJInfo qjinfo) { object obj = SQLHelper.ExecuteScalar("insert into T_qj(begintime, endtime, totaltime, reason, typeid) output inserted.id values(@begintime, @endtime, @totaltime, @reason, @typeid)", qjinfo.BeginTime, qjinfo.EndTime, qjinfo.TotalTime, qjinfo.Reason, qjinfo.TypeId); return(Convert.ToInt32(obj)); }