public void InsertOrUpdateSortHtml(int sortId, int propertyType) { string whereSql = "sortId={0} and htmlType={1}"; int firstIdByWhere = base.Session.GetFirstIdByWhere <Sys_sortHtml>(whereSql, new object[2] { sortId, propertyType }); if (firstIdByWhere <= 0) { Sys_sortHtml sys_sortHtml = new Sys_sortHtml(); sys_sortHtml.Sortid = sortId; sys_sortHtml.Htmltype = propertyType; sys_sortHtml.Updatestate = 1; sys_sortHtml.Modifytime = DateTime.Now; base.Session.Insert(sys_sortHtml); } else { Sys_sortHtml sys_sortHtml = new Sys_sortHtml(); sys_sortHtml.Id = firstIdByWhere; sys_sortHtml.Updatestate = 1; sys_sortHtml.Modifytime = DateTime.Now; base.Session.UpdateByKey(sys_sortHtml); } }
public void InitialPropertyHtmlUpdateState() { string whereSql = "1=1"; Sys_sortHtml sys_sortHtml = new Sys_sortHtml(); sys_sortHtml.Updatestate = 0; base.Session.UpdateByWhere(sys_sortHtml, whereSql, null); }