Exemplo n.º 1
0
 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)));
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 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;
         }
     }
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 public static void UpdateAttributeClass(AttributeClassInfo attributeClass)
 {
     dal.UpdateAttributeClass(attributeClass);
     CacheHelper.Remove(cacheKey);
 }
Exemplo n.º 8
0
 public static int AddAttributeClass(AttributeClassInfo attributeClass)
 {
     attributeClass.ID = dal.AddAttributeClass(attributeClass);
     CacheHelper.Remove(cacheKey);
     return(attributeClass.ID);
 }