コード例 #1
0
        private void addProductCategory()
        {
            ProductCategoryInfo procate = new ProductCategoryInfo();

            procate.title       = txtTitle.Text;
            procate.description = txtDesciption.Text;
            procate.create_by   = (SessionApp.user_info == null) ? "No Login" : SessionApp.user_info.user_name;
            var result = ProductController.AddProductCategory(procate);

            if (result == null)
            {
                ShowMessage(Page, "ชื่อหมวดหมู่นี้มีอยู่ในระบบแล้ว");
            }
            else
            {
                ShowMessage(Page, "เพิ่มหมวดหมู่สำเร็จ");
            }
        }
コード例 #2
0
        /// <summary>
        /// SAVE THE NEW PRODUCT CATEGORY
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveCat_Click(object sender, EventArgs e)
        {
            if (AddProductCategoriestxt.Text.Length <= 0)
            {
                AddProductCategoriestxt.Focus();
                return;
            }
            else
            {
                pmodel = new ProductModel();
                pmodel.ProductCategory = AddProductCategoriestxt.Text;
                productController.AddProductCategory(pmodel);

                //MessageBox.Show("Products Category Saved", "Server Response", MessageBoxButtons.OK, MessageBoxIcon.Information);
                AddProductCategoriestxt.Text = null;
                LoadProductCategories();
                return;
            }
        }