예제 #1
0
        public ActionResult DeleteProductCategory(string categoryCode)
        {
            var result = false;

            string message = string.Empty;

            try
            {
                result = new NetStock.BusinessFactory.ProductCategoryBO().DeleteProductCategory(new NetStock.Contract.ProductCategory {
                    CategoryCode = categoryCode
                });
                TempData["isSaved"] = result;

                if (result)
                {
                    @TempData["resultMessage"] = string.Format("Product Category  [{0}] Deleted Successfully", categoryCode);
                }
                else
                {
                    @TempData["resultMessage"] = "Unable to DELETE the Record!";
                }
            }
            catch (Exception ex)
            {
                @TempData["isSaved"]       = false;
                @TempData["resultMessage"] = string.Format("Error Occurred {0}", ex.Message.ToString());
                ModelState.AddModelError("Error", ex.Message);
            }

            return(RedirectToAction("ProductCategoryList", "MasterData"));
        }
예제 #2
0
        public ActionResult EditProductCategory(string categoryCode)
        {
            var productCategory = new NetStock.Contract.ProductCategory();

            if (categoryCode != null && categoryCode.Length > 0)
            {
                productCategory = new NetStock.BusinessFactory.ProductCategoryBO().GetProductCategory(new ProductCategory {
                    CategoryCode = categoryCode
                });
            }

            return(PartialView("ProductCategory", productCategory));
        }
예제 #3
0
파일: Utility.cs 프로젝트: ragsarma/ALLIUM
        public static IEnumerable <SelectListItem> GetProductCategory()
        {
            var lstLookUp = new NetStock.BusinessFactory.ProductCategoryBO().GetList();

            if (lstLookUp == null)
            {
                return(null);
            }

            var selectList = lstLookUp.Select(c =>
                                              new SelectListItem
            {
                Value = c.CategoryCode,
                Text  = c.Description
            });

            return(new SelectList(selectList, "Value", "Text"));
        }
예제 #4
0
        public ActionResult SaveProductCategory(NetStock.Contract.ProductCategory productCategory)
        {
            try
            {
                if (productCategory == null)
                {
                    return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
                }


                productCategory.CreatedBy  = Session["DEFAULTUSER"].ToString();
                productCategory.ModifiedBy = Session["DEFAULTUSER"].ToString();

                var result = new NetStock.BusinessFactory.ProductCategoryBO().SaveProductCategory(productCategory);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", ex.Message);
            }
            return(RedirectToAction("ProductCategoryList"));
        }
예제 #5
0
        public ActionResult ProductCategoryList()
        {
            var lstLookup = new NetStock.BusinessFactory.ProductCategoryBO().GetList();

            return(View("ProductCategoryList", lstLookup));
        }