Пример #1
0
        public JsonResult AddUpd(Model.ProductCategory pcategory)
        {
            string strResult = "FAIL";

            if (pcategory.CategoryName != null)
            {
                MoyeBuy.Com.BLL.ProductCategory category = new BLL.ProductCategory();
                if (category.AddUpdateProductCatgory(pcategory))
                {
                    strResult = "SUCCESS";
                }
            }
            return(Json(strResult));
        }
Пример #2
0
        public JsonResult Del(string strCategoryID)
        {
            string strResult = "FAIL";

            if (strCategoryID != "")
            {
                MoyeBuy.Com.BLL.ProductCategory category = new BLL.ProductCategory();
                if (category.DelProductCatgory(strCategoryID))
                {
                    strResult = "SUCCESS";
                }
            }
            return(Json(strResult));
        }
Пример #3
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            string code = codeTextBox.Text.Trim();
            string name = nameTextBox.Text.Trim();

            if (!CheckValidation(code, name))
            {
                MessageBox.Show("Invalid Inputs");
            }

            Models.ProductCategory productCategory = new Models.ProductCategory();
            productCategory.Code         = code;
            productCategory.CategoryName = name;

            BLL.ProductCategory _productCategory = new BLL.ProductCategory();
            if (!_productCategory.AddProductCategory(productCategory))
            {
                return;
            }

            DisplayProductCategories();
        }
Пример #4
0
 private void DisplayProductCategories()
 {
     BLL.ProductCategory _productCategory = new BLL.ProductCategory();
     categoriesDataGridView.DataSource = _productCategory.GetProductCategories();
 }