Ejemplo n.º 1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            ProductClassInfo productClass = new ProductClassInfo();

            productClass.ID          = RequestHelper.GetQueryString <int>("ID");
            productClass.FatherID    = Convert.ToInt32(this.FatherID.Text);
            productClass.OrderID     = Convert.ToInt32(this.OrderID.Text);
            productClass.ClassName   = this.ClassName.Text;
            productClass.Keywords    = this.Keywords.Text;
            productClass.Description = this.Description.Text;
            productClass.IsDownload  = Convert.ToInt32(this.IsDownload.Text);
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (productClass.ID == -2147483648)
            {
                base.CheckAdminPower("AddProductClass", PowerCheckType.Single);
                int id = ProductClassBLL.AddProductClass(productClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ProductClass"), id);
            }
            else
            {
                base.CheckAdminPower("UpdateProductClass", PowerCheckType.Single);
                ProductClassBLL.UpdateProductClass(productClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ProductClass"), productClass.ID);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }