/// <summary> /// /// </summary> /// <param name="lang"></param> public void DropCategory(MCategory cat) { _DBE.ReInit(); _DBE.AddTable(DataConst.C2010200); _DBE.AddWhere(DataConst.C2010203, cat.C2010203); _DBE.ExecuteDelete(); }
/// <summary> /// /// </summary> /// <param name="row"></param> /// <returns></returns> private static MCategory ReadCategory(DataRow row) { var cat = new MCategory(); cat.C2010201 = (int)row[DataConst.C2010201]; cat.C2010202 = (int)row[DataConst.C2010202]; cat.C2010203 = row[DataConst.C2010203] + ""; cat.C2010204 = row[DataConst.C2010204] + ""; cat.C2010205 = row[DataConst.C2010205] + ""; cat.C2010206 = row[DataConst.C2010206] + ""; cat.C2010207 = row[DataConst.C2010207] + ""; cat.C2010208 = row[DataConst.C2010208] + ""; cat.C2010209 = row[DataConst.C2010209] + ""; return cat; }
/// <summary> /// /// </summary> /// <param name="cat"></param> public void SaveCategory(MCategory cat) { _DBE.ReInit(); _DBE.AddTable(DataConst.C2010200); _DBE.AddParam(DataConst.C2010201, cat.C2010201); _DBE.AddParam(DataConst.C2010202, cat.C2010202); _DBE.AddParam(DataConst.C2010204, cat.C2010204); _DBE.AddParam(DataConst.C2010205, cat.C2010205); _DBE.AddParam(DataConst.C2010206, cat.C2010206); _DBE.AddParam(DataConst.C2010207, cat.C2010207); _DBE.AddParam(DataConst.C2010208, cat.C2010208); _DBE.AddParam(DataConst.C2010209, cat.C2010209); _DBE.AddParam(DataConst.C201020A, DataConst.NOW, false); if (CharUtil.IsValidateHash(cat.C2010203)) { _DBE.AddWhere(DataConst.C2010203, cat.C2010203); _DBE.ExecuteUpdate(); } else { cat.C2010203 = HashUtil.UtcTimeInEnc(false); _DBE.AddParam(DataConst.C2010203, cat.C2010203); _DBE.AddParam(DataConst.C201020B, DataConst.NOW, false); _DBE.ExecuteInsert(); } }
public MCategory SaveCategory(string text) { var cat = new MCategory(); cat.C2010204 = "P3100100"; cat.C2010205 = text; cat.C2010206 = text; cat.C2010207 = ""; cat.C2010208 = ""; cat.C2010209 = ""; SaveCategory(cat); return cat; }