Example #1
0
        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));
        }
Example #4
0
        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);
        }
        // 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));
        }