Example #1
0
        public string CheckDuplicateName(string Name, string ID)
        {
            var groups = ProductGroupLogic.GetProductGroupByID(0);

            if (groups != null && groups.Count() > 0)
            {
                if (Convert.ToInt32(ID) > 0)
                {
                    groups = groups.Where(x => x.Name == Name && x.ID != Convert.ToInt32(ID));
                }
                else
                {
                    groups = groups.Where(x => x.Name == Name);
                }
                if (groups.Count() > 0)
                {
                    return("false");
                }
                else
                {
                    return("true");
                }
            }
            else
            {
                return("true");
            }
        }
Example #2
0
        //
        // GET: /ProductGroup/


        public ActionResult Add(string ID)
        {
            ViewBag.ProductGroupTypes = ProductGroupTypeLogic.GetAllProductGroupTypes();
            if (Convert.ToInt32(ID) > 0)
            {
                var packing = ProductGroupLogic.GetProductGroupByID(Convert.ToInt32(ID)).FirstOrDefault();
                return(View(packing));
            }
            else
            {
                return(View(new ProductGroup()));
            }
        }
        public JsonResult GetGroupType(int GroupID)
        {
            ResponseMsg response = new ResponseMsg();

            if (GroupID > 0)
            {
                var group = ProductGroupLogic.GetProductGroupByID(GroupID);
                if (group != null)
                {
                    response.IsSuccess     = true;
                    response.ResponseValue = group;
                }
            }
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        //
        // GET: /Product/

        public ActionResult Add(string ID)
        {
            ViewBag.Shades           = ShadeLogic.GetShadeByID(0);
            ViewBag.Packings         = PackingLogic.GetPackingByID(0);
            ViewBag.ProductGroups    = ProductGroupLogic.GetProductGroupByID(0);
            ViewBag.ProductUnits     = ProductUnitLogic.GetProductUnitByID(0);
            ViewBag.Parties          = PartyLogic.GetPartyByID(0).Select(x => new { x.ID, x.Name });
            ViewBag.RawMaterialTypes = RawMaterialTypeLogic.RawMaterialTypeByID(0);
            if (Convert.ToInt32(ID) > 0)
            {
                var product = ProductLogic.GetProductByID(Convert.ToInt32(ID)).FirstOrDefault();
                return(View(product));
            }
            else
            {
                return(View(new Product()));
            }
        }
Example #5
0
 public ActionResult GetAll()
 {
     return(PartialView("GetAll", ProductGroupLogic.GetProductGroupByID(0)));
 }