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