public int AddAttributeClass(AttributeClassInfo attributeClass) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@attributeCount", SqlDbType.Int) }; pt[0].Value = attributeClass.Name; pt[1].Value = attributeClass.AttributeCount; return(Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddAttributeClass", pt))); }
public void UpdateAttributeClass(AttributeClassInfo attributeClass) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@attributeCount", SqlDbType.Int) }; pt[0].Value = attributeClass.ID; pt[1].Value = attributeClass.Name; pt[2].Value = attributeClass.AttributeCount; ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "UpdateAttributeClass", pt); }
public void PrepareAttributeClassModel(SqlDataReader dr, List <AttributeClassInfo> attributeClassList) { while (dr.Read()) { AttributeClassInfo item = new AttributeClassInfo(); item.ID = dr.GetInt32(0); item.Name = dr[1].ToString(); item.AttributeCount = dr.GetInt32(2); attributeClassList.Add(item); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { base.CheckAdminPower("ReadAttributeClass", PowerCheckType.Single); AttributeClassInfo info = AttributeClassBLL.ReadAttributeClassCache(queryString); this.Name.Text = info.Name; } } }
public static AttributeClassInfo ReadAttributeClassCache(int id) { AttributeClassInfo info = new AttributeClassInfo(); List <AttributeClassInfo> list = ReadAttributeClassCacheList(); foreach (AttributeClassInfo info2 in list) { if (info2.ID == id) { return(info2); } } return(info); }
protected void SubmitButton_Click(object sender, EventArgs e) { AttributeClassInfo attributeClass = new AttributeClassInfo(); attributeClass.ID = RequestHelper.GetQueryString <int>("ID"); attributeClass.Name = this.Name.Text; attributeClass.AttributeCount = 0; string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (attributeClass.ID == -2147483648) { base.CheckAdminPower("AddAttributeClass", PowerCheckType.Single); int id = AttributeClassBLL.AddAttributeClass(attributeClass); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AttributeClass"), id); } else { base.CheckAdminPower("UpdateAttributeClass", PowerCheckType.Single); AttributeClassBLL.UpdateAttributeClass(attributeClass); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AttributeClass"), attributeClass.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
public static void UpdateAttributeClass(AttributeClassInfo attributeClass) { dal.UpdateAttributeClass(attributeClass); CacheHelper.Remove(cacheKey); }
public static int AddAttributeClass(AttributeClassInfo attributeClass) { attributeClass.ID = dal.AddAttributeClass(attributeClass); CacheHelper.Remove(cacheKey); return(attributeClass.ID); }