public ActionResult FillProductTable(string selected)
        {
            //if (selected != null)
            var product = ProductTableData.getAllProducts().Where(x => x.Model == selected).Select(x => new { ID = x.ID, Type = x.Type, Model = x.Model, Quantity = x.Quantity_Available, UnitPrice = x.Unit_Price, SellingPrice = x.Selling_Price, UniqueBarcode = x.Unique_Barcode }).FirstOrDefault();

            //, UnitPrice = x.Unit_Price, SellingPrice = x.Selling_Price, UniqueBarcode = x.Unique_Barcode
            return(new JsonResult {
                Data = product, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public ActionResult FillPrices(string selected)
        {
            //if (selected != null)
            var prices = ProductTableData.getAllProducts().Where(x => x.Model == selected).Select(x => new { ID = x.ID, UnitPrice = x.Unit_Price, SellingPrice = x.Selling_Price, UniqueBarcode = x.Unique_Barcode, Description = x.Des }).FirstOrDefault();

            //, UnitPrice = x.Unit_Price, SellingPrice = x.Selling_Price, UniqueBarcode = x.Unique_Barcode
            return(new JsonResult {
                Data = prices, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public ActionResult FillDDLModel(string selected)
        {
            //if (selected != null)
            var models = ProductTableData.getAllProducts().Where(x => x.Type == selected).Select(x => new { ID = x.ID, Model = x.Model }).ToList();

            //, UnitPrice = x.Unit_Price, SellingPrice = x.Selling_Price, UniqueBarcode = x.uni
            return(new JsonResult {
                Data = models, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Beispiel #4
0
        // GET: Purchase
        public ActionResult Index()
        {
            ViewBag.test = ProductTableData.getAllProducts();
            string[] supplier = SupplierTableData.getAllSupplierName().ToArray();
            string[] types    = ProductTableData.getAllProductTypes().ToArray();
            ViewData["supplierList"]     = supplier;
            ViewData["typeList"]         = types;
            ViewData["modelList"]        = new string[] { "Select" };
            ViewData["selectedType"]     = "Select";
            ViewData["selectedSupplier"] = "Select";

            return(View());
        }
        // GET: PurchaseTest
        public ActionResult Index()
        {
            ViewBag.test = ProductTableData.getAllProducts();
            string[] supplier = SupplierTableData.getAllSupplierName().ToArray();
            string[] types    = ProductTableData.getAllProductTypes().ToArray();
            string[] colors   = FileManagement.getAllColor().ToArray();
            ViewBag.supplierList     = supplier;
            ViewData["supplierList"] = supplier;
            ViewData["typeList"]     = types;
            ViewData["colorList"]    = colors;

            ViewData["selectedSupplier"] = "Select";
            ViewData["selectedType"]     = "Select";
            ViewData["selectedModel"]    = "Select";
            ViewData["modelList"]        = new string[] { "Select" };
            ViewData["selectedColor"]    = "None";

            return(View());
        }