예제 #1
0
        //The following code used for Stock taking in order to generate Adjustment Voucher
        public ActionResult Check(string sessionId)
        {
            List <Inventory> inventories = CatalogueService.GetAllCatalogue();

            ViewData["inventories"] = inventories;
            ViewData["sessionId"]   = sessionId;
            return(View());
        }
        public ActionResult Delete(bool confirm, long itemId, string sessionId)
        {
            if (confirm)
            {
                if (PriceListService.GetPriceListByItemId(itemId) != null)
                {
                    PriceListService.DeletePriceList(itemId);
                }

                CatalogueService.DeleteCatalogue(itemId);

                List <Inventory> catalogues = CatalogueService.GetAllCatalogue();
                ViewData["catalogues"] = catalogues;
                return(RedirectToAction("All", new { sessionid = sessionId }));
            }
            return(null);
        }
        public ActionResult CreatePriceList(long ItemId, PriceList priceList, string sessionId)
        {
            if (priceList.Supplier1Name == priceList.Supplier2Name || priceList.Supplier2Name == priceList.Supplier3Name || priceList.Supplier3Name == priceList.Supplier1Name)
            {
                TempData["errorMsg"] = "<script>alert('Please select three different suppliers.');</script>";
                return(RedirectToAction("CreateNext", new { itemId = ItemId, sessionid = sessionId }));
            }
            else
            {
                priceList.Item        = new Inventory();
                priceList.Item.ItemId = ItemId;
                PriceListService.CreatePriceListDetaills(priceList);

                List <Inventory> catalogues = CatalogueService.GetAllCatalogue();
                ViewData["catalogues"] = catalogues;
                return(RedirectToAction("All", new { sessionid = sessionId }));
            }
        }