public ActionResult Bar() { ProductGroupChartManager objPGChartManager = new ProductGroupChartManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); var lstData = objPGChartManager.GetAll().ToList(); List <string> categories = new List <string>(); List <decimal> lstProductQty = new List <decimal>(); List <decimal> lstFinishedQty = new List <decimal>(); List <decimal> lstBalanceQty = new List <decimal>(); GroupBarModel model = new GroupBarModel(); model.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberListManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); foreach (VW_ProductGroupChart obj in lstData) { categories.Add(obj.Productname + "-" + obj.Processname); lstProductQty.Add(obj.ProductQtyfrom); lstFinishedQty.Add(obj.FinishedQty); lstBalanceQty.Add(obj.BalanceQty); } model.categories = JsonConvert.SerializeObject(categories); model.ProductQty = JsonConvert.SerializeObject(lstProductQty); model.FinishedQty = JsonConvert.SerializeObject(lstFinishedQty); model.BalanceQty = JsonConvert.SerializeObject(lstBalanceQty); return(View(model)); }
public ActionResult ResetBar(string BuyerOrderNumberName) { ProductGroupChartManager objPGChartManager = new ProductGroupChartManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); var lstData = new List <VW_ProductGroupChart>(); if (!string.IsNullOrEmpty(BuyerOrderNumberName)) { lstData = objPGChartManager.GetAll(c => c.BuyerOrderNumberName == BuyerOrderNumberName).ToList(); } else { lstData = objPGChartManager.GetAll().ToList(); } List <string> categories = new List <string>(); List <decimal> lstProductQty = new List <decimal>(); List <decimal> lstFinishedQty = new List <decimal>(); List <decimal> lstBalanceQty = new List <decimal>(); GroupBarModel model = new GroupBarModel(); model.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberListManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); if (lstData != null && lstData.Count() > 0) { foreach (VW_ProductGroupChart obj in lstData) { categories.Add(obj.Productname + "-" + obj.Processname); lstProductQty.Add(obj.ProductQtyfrom); lstFinishedQty.Add(obj.FinishedQty); lstBalanceQty.Add(obj.BalanceQty); } return(Json(new { Error = false, Categories = categories, ProductQty = lstProductQty, FinishedQty = lstFinishedQty, BalanceQty = lstBalanceQty })); } else { return(Json(new { Error = true })); } }