public ActionResult PurchaseOrder(string poNumber, string vendorno)
        {
            // TempData["data"] = poNumber;
            // ViewBag.vendorNo = vendorno;
            SpfxPODetails poList = new SpfxPODetails();

            poList = GetDataHelper.GetPODetails();
            List <POValue> podetaillist = poList.value.Where(a => a.PONumber.Equals(poNumber)).ToList();

            int poTotal = 0;

            for (int poCount = 0; poCount < podetaillist.Count; poCount++)
            {
                podetaillist[poCount].Total = (Convert.ToInt32(podetaillist[poCount].UnitPrice) * Convert.ToInt32(podetaillist[poCount].Quantity));
                //poTotal += Convert.ToInt32(poList.value[poCount]);
                poTotal = poTotal + Convert.ToInt32(podetaillist[poCount].Total);
            }
            string TotalPOSum = poTotal.ToString();
            // ViewData["Sum"] = TotalPOSum;

            var purchaseViewModel = new PurchaseViewModel()
            {
                PoNumber = poNumber, TotalSum = TotalPOSum, PoValues = podetaillist, VendorNumber = vendorno
            };

            // ViewData["poDetails"] = podetaillist;


            return(View(purchaseViewModel));
        }
Beispiel #2
0
        public static SpfxPODetails GetPODetails()
        {
            string        file = System.Web.Hosting.HostingEnvironment.MapPath("~/TestData/") + @"/PODetailsMock.json";
            SpfxPODetails POs  = new SpfxPODetails();
            string        json = File.ReadAllText(file).Replace("##BaseURL##", ApplicationSettings.BaseUrl);

            POs = (new JavaScriptSerializer().Deserialize <SpfxPODetails>(json));
            return(POs);
        }