public ActionResult Gantt() { ProductManager objProductManager = new ProductManager(new DataContext()); BuyerListManager objBuyername = new BuyerListManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumber = new BuyerOrderNumberListManager(new DataContext()); ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); List <BuyerOrderNumber> lstBuyerOrderNumber = objBuyerOrderNumber.GetAll(); List <ProductUpdateGrid> lstProductUpdateGrid = objProductManager.GetProductMasterList(); int i = 1; List <ProductGantt> lst = new List <ProductGantt>(); foreach (BuyerOrderNumber obj in lstBuyerOrderNumber) { ProductGantt obj1 = new ProductGantt(); obj1.id = i; obj1.name = obj.BuyerOrderNumberName; List <Series> s1 = lstProductUpdateGrid.Where(c => c.BuyerOrderNumberName == obj.BuyerOrderNumberName).Select(c => new Series { start = c.StartDate.Value, end = c.SPCDate.Value, name = c.Processname, color = null }).ToList(); obj1.series = s1; lst.Add(obj1); i++; } ProductGantt_Model model = new ProductGantt_Model(); model.ProcessList = Extens.ToSelectList(objProcessListManager.GetDtProcess(), "Processname", "Processname"); model.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumber.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); model.SeriesList = lst; model.Json = JsonConvert.SerializeObject(lst); return(View(model)); }
public ActionResult AddEditProductMaster(int ProductID = 0) { BuyerListManager objBuyerListManager = new BuyerListManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); SupplierListManager objSupplierListManager = new SupplierListManager(new DataContext()); ProductListManager objProductListManager = new ProductListManager(new DataContext()); UnitListManager objUnitListManager = new UnitListManager(new DataContext()); SetNoteListManager objSetNoteListManager = new SetNoteListManager(new DataContext()); ProductManager context = new ProductManager(new DataContext()); ProductUpdateGrid_Model objModel = new ProductUpdateGrid_Model(); if (ProductID != 0) { objModel.Table = context.GetProductMasterById(ProductID); } else { objModel.Table = new ProductUpdateGrid(); } objModel.BuyerList = Extens.ToSelectList(objBuyerListManager.GetDtBuyer(), "Buyername", "Buyername"); objModel.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberListManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); objModel.ProcessList = Extens.ToSelectList(objProcessListManager.GetDtProcess(), "Processname", "Processname"); objModel.SupplierList = Extens.ToSelectList(objSupplierListManager.GetDtSupplier(), "Suppliername", "Suppliername"); objModel.ProductList = Extens.ToSelectList(objProductListManager.GetDtProduct(), "Productname", "Productname"); objModel.UnitList = Extens.ToSelectList(objUnitListManager.GetDtUnit(), "Unitname", "Unitname"); objModel.SetNoteList = Extens.ToSelectList(objSetNoteListManager.GetDtSetNote(), "Setnotename", "Setnotename"); return(PartialView("ProductMasterCRUD", objModel)); }
public ActionResult GanttChart() { BuyerListManager objBuyername = new BuyerListManager(new DataContext()); var lstBuyername = Extens.ToSelectList(objBuyername.GetDtBuyer(), "Buyername", "Buyername"); ViewBag.LstBuyername = lstBuyername; return(View()); }
// GET: UserDashboard public ActionResult Dashboard() { FinalLineInspectionManager context1 = new FinalLineInspectionManager(new DataContext()); InLineInspectionManager context2 = new InLineInspectionManager(new DataContext()); MidLineInspectionManager context3 = new MidLineInspectionManager(new DataContext()); OrderPackingManager context4 = new OrderPackingManager(new DataContext()); OrdersDespatcheManager context5 = new OrdersDespatcheManager(new DataContext()); UserManager context6 = new UserManager(new DataContext()); DSProductUpdateGridManager context7 = new DSProductUpdateGridManager(new DataContext()); PKGKDManager context8 = new PKGKDManager(new DataContext()); PKGKDDespatchManager context9 = new PKGKDDespatchManager(new DataContext()); DashboardModel model = new DashboardModel(); model.LstFinalLineInspection = context1.GetList(); model.LstInLineInspection = context2.GetList(); model.LstMidLineInspection = context3.GetList(); model.LstOrderPacking = context4.GetList(); model.LstOrdersDespatche = context5.GetList(); model.LstDSProductUpdateGrid = context7.GetList(); model.LstBuyerOrderPackingList = context8.GetList(); model.LstBuyerOrderDespatchList = context9.GetList(); List <string> labels = new List <string>(); labels.Add("Online User"); labels.Add("Offline User"); List <int> series = new List <int>(); int onlineUsers = 0; int totUsers = context6.GetTotalUserCount(); var allUser = context6.GetAll().ToList(); if (HttpContext.Application["TotalOnlineUsers"] != null) { onlineUsers = Convert.ToInt32(HttpContext.Application["TotalOnlineUsers"]); } if (HttpContext.Application["OnlineUsers"] != null) { string user = (string)HttpContext.Application["OnlineUsers"]; List <string> lstUser = user.Split(',').ToList(); model.LstUser = allUser.Where(c => lstUser.Contains(c.UserId.ToString())).Select(c => new Tuple <string, string>(c.UserName, c.ImageName)).ToList(); } BuyerListManager objbuyerNameManager = new BuyerListManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberNameManager = new BuyerOrderNumberListManager(new DataContext()); ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); model.BuyerList = Extens.ToSelectList(objbuyerNameManager.GetDtBuyer(), "Buyername", "Buyername"); model.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberNameManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); model.ProcessList = Extens.ToSelectList(objProcessListManager.GetDtProcess(), "Processname", "Processname"); int offlineUsers = totUsers - onlineUsers; series.Add(onlineUsers); series.Add(offlineUsers); model.labels = JsonConvert.SerializeObject(labels); model.series = JsonConvert.SerializeObject(series); ViewBag.OnlineUser = model.LstUser; return(View(model)); }
public void BindProductGrid(ProductUpdateGrid_Model objModel, int page, int pageSize) { BuyerListManager objBuyerListManager = new BuyerListManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); SupplierListManager objSupplierListManager = new SupplierListManager(new DataContext()); ProductListManager objProductListManager = new ProductListManager(new DataContext()); UnitListManager objUnitListManager = new UnitListManager(new DataContext()); SetNoteListManager objSetNoteListManager = new SetNoteListManager(new DataContext()); ProductManager context = new ProductManager(new DataContext()); PlannerManager pln_context = new PlannerManager(new DataContext()); FinishingManager fis_context = new FinishingManager(new DataContext()); objModel.PlannerUpdateGridList = pln_context.GetPlannerUpdateGridList(); objModel.FinishingUpdateGridList = fis_context.GetFinishingUpdateGridList(); StringBuilder query = new StringBuilder(); var colName = common.GetColumns(CommonFunction.module.ProductMaster.ToString()); query = common.GetSqlTableQuery(CommonFunction.module.ProductMaster.ToString()); string uProcess = ""; if (Session["UserProcess"] != null) { uProcess = Session["UserProcess"].ToString(); } uProcess = "'" + uProcess.Replace(",", "','") + "'"; query.Append(" AND Processname IN (" + uProcess + ") AND "); if (objModel != null) { objModel.StaticPageSize = pageSize; } objModel.BuyerList = Extens.ToSelectList(objBuyerListManager.GetDtBuyer(), "ByrID", "Buyername"); objModel.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberListManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberID", "BuyerOrderNumberName"); objModel.ProcessList = Extens.ToSelectList(objProcessListManager.GetDtProcess(), "ProcID", "Processname"); objModel.SupplierList = Extens.ToSelectList(objSupplierListManager.GetDtSupplier(), "SupID", "Suppliername"); objModel.ProductList = Extens.ToSelectList(objProductListManager.GetDtProduct(), "PrdID", "Productname"); objModel.UnitList = Extens.ToSelectList(objUnitListManager.GetDtUnit(), "UnitID", "Unitname"); objModel.SetNoteList = Extens.ToSelectList(objSetNoteListManager.GetDtSetNote(), "SetID", "Setnotename"); objModel.sortOrder = "desc"; objModel.fieldName = "ProductID"; context.setModel(query, objModel, colName, "ProductID", page, pageSize); }
public ActionResult SetGanttChart(string BON = "") { BuyerListManager objBuyername = new BuyerListManager(new DataContext()); ProdcutGroupGanttManager objPGGantttManager = new ProdcutGroupGanttManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); List <VW_ProdcutGroupGantt> lstData = new List <VW_ProdcutGroupGantt>(); if (string.IsNullOrEmpty(BON)) { lstData = objPGGantttManager.GetAll().ToList(); } else { lstData = objPGGantttManager.GetAll(c => c.Buyername == BON).ToList(); } List <TaskViewModel> lstTData = new List <TaskViewModel>(); List <string> lstBDN = new List <string>(); int ord = 1; foreach (var objData in lstData) { TaskViewModel obj = new TaskViewModel(); obj.ID = Convert.ToInt32(objData.ID); obj.Title = objData.Productname; obj.Start = DateTime.SpecifyKind(objData.StartDate.Value, DateTimeKind.Utc); obj.End = DateTime.SpecifyKind(objData.SPCDate.Value, DateTimeKind.Utc); obj.ParentID = null; obj.PercentComplete = Convert.ToDouble(objData.Done) / 100.00; obj.OrderID = ord; obj.ChildId = ord; obj.Expanded = true; obj.Summary = false; obj.NoDays = objData.NoDays; obj.Buyername = objData.Buyername; obj.BuyerOrderNumberName = objData.BuyerOrderNumberName; obj.Processname = objData.Processname; obj.Done = objData.Done; obj.DelayedDays = objData.DelayedDays; obj.SKUStart = objData.SKUStartDate; obj.SKUEnd = objData.SKUEndDate; lstTData.Add(obj); ord++; } return(Json(new { data = lstTData })); }
// GET: AdminChart public ActionResult Index() { ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); BuyerListManager objBuyerListManager = new BuyerListManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); VW_ProductSummaryManager objVW_ProductSummaryManager = new VW_ProductSummaryManager(new DataContext()); List <VW_ProductSummary> lst = objVW_ProductSummaryManager.GetProductSummaryList(); SeriesData obj1 = new SeriesData(); obj1.name = "ProductQty"; obj1.data = lst.Select(c => c.ProductQty).ToList(); SeriesData obj2 = new SeriesData(); obj2.name = "FinishedQty"; obj2.data = lst.Select(c => c.FinishedQty).ToList(); SeriesData obj3 = new SeriesData(); obj3.name = "BalanceQty"; obj3.data = lst.Select(c => c.BalanceQty).ToList(); List <SeriesData> SeriesData = new List <SeriesData>(); SeriesData.Add(obj1); SeriesData.Add(obj2); SeriesData.Add(obj3); VW_ProductSummary_Model objModel = new VW_ProductSummary_Model(); objModel.BuyerList = Extens.ToSelectList(objBuyerListManager.GetDtBuyer(), "Buyername", "Buyername"); objModel.BuyerOrderNumberList = Extens.ToSelectList(objBuyerOrderNumberListManager.GetDtBuyerOrderNumber(), "BuyerOrderNumberName", "BuyerOrderNumberName"); objModel.ProcessList = Extens.ToSelectList(objProcessListManager.GetDtProcess(), "Processname", "Processname"); objModel.SeriesList = SeriesData; objModel.Json = JsonConvert.SerializeObject(SeriesData); objModel.categories = JsonConvert.SerializeObject(lst.Select(c => c.Buyername + " / " + c.BuyerOrderNumberName + " / " + c.Processname).ToList()); return(View(objModel)); }
public ActionResult SetGanttChart1(string BON = "") { ProdcutGroupGanttManager objPGGantttManager = new ProdcutGroupGanttManager(new DataContext()); BuyerOrderNumberListManager objBuyerOrderNumberListManager = new BuyerOrderNumberListManager(new DataContext()); BuyerListManager objBuyerListManager = new BuyerListManager(new DataContext()); ProcessListManager objProcessListManager = new ProcessListManager(new DataContext()); ProductNameManager objProductNameManager = new ProductNameManager(new DataContext()); List <VW_ProdcutGroupGantt> lstData = new List <VW_ProdcutGroupGantt>(); if (string.IsNullOrEmpty(BON)) { lstData = objPGGantttManager.GetAll().ToList(); } else { lstData = objPGGantttManager.GetAll(c => c.Buyername == BON).ToList(); } List <TaskViewModel> lstTData = new List <TaskViewModel>(); List <string> lstBDN = objBuyerListManager.GetAll().ToList().Select(c => c.BuyerName).ToList(); List <string> lstODN = objBuyerOrderNumberListManager.GetAll().ToList().Select(c => c.BuyerOrderNumberName).ToList(); List <string> lstPSN = objProcessListManager.GetAll().ToList().Select(c => c.ProcessName).ToList(); List <string> lstPDN = objProductNameManager.GetAll().ToList().Select(c => c.ProductName).ToList(); int ord = 1; foreach (string bo in lstBDN) { var lstByBON = lstData.Where(c => c.Buyername == bo); if (lstByBON.Count() > 0) { DateTime sDateBON = lstByBON.Min(c => c.StartDate).Value; DateTime eDateBON = lstByBON.Max(c => c.SPCDate).Value; DateTime?skusDate = lstByBON.Min(c => c.SKUStartDate); DateTime?skueeDate = lstByBON.Max(c => c.SKUEndDate); if (skusDate == null) { } TaskViewModel obj = new TaskViewModel(); obj.ID = ord; obj.Title = bo; obj.ParentID = null; obj.PercentComplete = Convert.ToDouble(lstByBON.FirstOrDefault().Done) / 100.00; obj.OrderID = ord; obj.ChildId = ord; obj.Start = DateTime.SpecifyKind(sDateBON, DateTimeKind.Utc); obj.End = DateTime.SpecifyKind(eDateBON, DateTimeKind.Utc); obj.Expanded = true; obj.Summary = true; obj.Done = lstByBON.Max(c => c.Done); obj.DelayedDays = lstByBON.Max(c => c.DelayedDays); obj.SKUStart = skusDate; obj.SKUEnd = skueeDate; lstTData.Add(obj); ord++; foreach (string ps in lstODN) { var lstByPS = lstData.Where(c => c.Buyername == bo && c.BuyerOrderNumberName == ps); if (lstByPS.Count() > 0) { DateTime sDatePS = lstByPS.Min(c => c.StartDate).Value; DateTime eDatePS = lstByPS.Max(c => c.SPCDate).Value; DateTime?skusDate1 = lstByBON.Min(c => c.SKUStartDate); DateTime?skueeDate1 = lstByBON.Max(c => c.SKUEndDate); if (skusDate1 == null) { } TaskViewModel obj1 = new TaskViewModel(); obj1.ID = ord; obj1.Title = ps; obj1.ParentID = obj.ID; obj1.Start = DateTime.SpecifyKind(sDatePS, DateTimeKind.Utc); obj1.End = DateTime.SpecifyKind(eDatePS, DateTimeKind.Utc); obj1.PercentComplete = Convert.ToDouble(lstByPS.FirstOrDefault().Done) / 100.00; obj1.OrderID = ord; obj1.ChildId = ord; obj1.Expanded = true; obj1.Summary = true; obj1.Done = lstByPS.Max(c => c.Done); obj1.DelayedDays = lstByPS.Max(c => c.DelayedDays); obj1.SKUStart = skusDate1; obj1.SKUEnd = skueeDate1; lstTData.Add(obj1); ord++; foreach (string vs in lstPSN) { var lstByVS = lstData.Where(c => c.Buyername == bo && c.BuyerOrderNumberName == ps && c.Processname == vs); if (lstByVS.Count() > 0) { DateTime sDateVS = lstByVS.Min(c => c.StartDate).Value; DateTime eDateVS = lstByVS.Max(c => c.SPCDate).Value; DateTime?skusDate2 = lstByBON.Min(c => c.SKUStartDate); DateTime?skueeDate2 = lstByBON.Max(c => c.SKUEndDate); if (skusDate1 == null) { } TaskViewModel obj2 = new TaskViewModel(); obj2.ID = ord; obj2.Title = vs; obj2.ParentID = obj1.ID; obj2.Start = DateTime.SpecifyKind(sDatePS, DateTimeKind.Utc); obj2.End = DateTime.SpecifyKind(eDatePS, DateTimeKind.Utc); obj2.PercentComplete = Convert.ToDouble(lstByVS.FirstOrDefault().Done) / 100.00; obj2.OrderID = ord; obj2.ChildId = ord; obj2.Expanded = true; obj2.Summary = true; obj2.Done = lstByVS.Max(c => c.Done); obj2.DelayedDays = lstByVS.Max(c => c.DelayedDays); obj2.SKUStart = skusDate2; obj2.SKUEnd = skueeDate2; lstTData.Add(obj2); ord++; foreach (string pd in lstPDN) { var lstByPD = lstData.Where(c => c.Buyername == bo && c.BuyerOrderNumberName == ps && c.Processname == vs && c.Productname == pd); if (lstByPD.Count() > 0) { foreach (var objData in lstByPD) { DateTime?skusDate3 = objData.SKUStartDate; DateTime?skueeDate3 = objData.SKUEndDate; if (skusDate3 == null) { } TaskViewModel obj3 = new TaskViewModel(); obj3.Title = objData.Productname; obj3.ID = ord; obj3.Start = DateTime.SpecifyKind(objData.StartDate.Value, DateTimeKind.Utc); obj3.End = DateTime.SpecifyKind(objData.SPCDate.Value, DateTimeKind.Utc); obj3.ParentID = obj2.ID; obj3.PercentComplete = Convert.ToDouble(objData.Done) / 100.00; obj3.OrderID = ord; obj3.ChildId = ord; obj3.Expanded = true; obj3.Summary = false; obj3.NoDays = objData.NoDays; obj3.Done = objData.Done; obj3.DelayedDays = objData.DelayedDays; obj3.SKUStart = skusDate3; obj3.SKUEnd = skueeDate3; lstTData.Add(obj3); ord++; } } } } } } } } } return(Json(new { data = lstTData })); }