internal static PXInfo GetInfoById(int innerid) { PXInfo info = new PXInfo(); DataTable dt = SQLHelper.ExecuteDataTable("select * from T_px where id = @id", innerid); info.Id = innerid; info.BeginDate = Convert.ToDateTime(dt.Rows[0]["begindate"].ToString()); info.EndDate = Convert.ToDateTime(dt.Rows[0]["enddate"].ToString()); info.TypeId = Convert.ToInt32(dt.Rows[0]["typeid"]); info.Title = dt.Rows[0]["title"].ToString(); info.AttachContent = dt.Rows[0]["attachcontent"].ToString(); return(info); }
internal static int UpdateInfo(PXInfo pxinfo, int id) { object obj = SQLHelper.ExecuteNonQuery("update T_px set begindate=@begindate, enddate=@enddate, typeid=@typeid, title=@title, attachcontent=@attachcontent where id=@id", pxinfo.BeginDate, pxinfo.EndDate, pxinfo.TypeId, pxinfo.Title, pxinfo.AttachContent, id); return(Convert.ToInt32(obj)); }
internal static int AddInfo(PXInfo pxinfo) { object obj = SQLHelper.ExecuteScalar("insert into T_px(begindate, enddate, typeid, title, attachcontent) output inserted.id values(@begindate, @enddate, @typeid, @title, @attachcontent)", pxinfo.BeginDate, pxinfo.EndDate, pxinfo.TypeId, pxinfo.Title, pxinfo.AttachContent); return(Convert.ToInt32(obj)); }