Exemplo n.º 1
0
        // GET: Ownership
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // OWN -> Ownership
            // Refer to UserAccessSession
            if (UASession == null || !UASession.OWN)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("OWN", "HOME", "LOG");

            // Get all data stored in DB table
            OwnershipManager   OSPManager   = new OwnershipManager();
            OwnershipViewModel OSPViewModel = new OwnershipViewModel();

            OSPViewModel.OHPList = OSPManager.GetOSP();
            if (OSPViewModel.OHPList == null || OSPViewModel.OHPList.Count() == 0)
            {
                OSPViewModel.OHPList = new List <OwnershipViewModel>();
            }
            // return View with ViewModel
            return(View(OSPViewModel));
        }
        // GET: DessertPriceTier
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // TIP -> Price Tier
            // Refer to UserAccessSession
            if (UASession == null || !UASession.TIP)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("TIP_DES", "HOME", "LOG");

            // Get all data stored in DB table
            DessertPriceTierManager   DPTManager   = new DessertPriceTierManager();
            DessertPriceTierViewModel DPTViewModel = new DessertPriceTierViewModel();

            DPTViewModel.DesPTList = DPTManager.GetDPT();
            if (DPTViewModel.DesPTList == null || DPTViewModel.DesPTList.Count() == 0)
            {
                DPTViewModel.DesPTList = new List <DessertPriceTierViewModel>();
            }
            // return View with ViewModel
            return(View(DPTViewModel));
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            // Reset ViewModelList Session
            if (Session["ViewModelList"] != null)
            {
                Session["ViewModelList"] = null;
            }

            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            Session["CurrentPage"] = new CurrentPageSession("HOME", "HOME", "LOG");

            HomeManager   HManager   = new HomeManager();
            UserSession   user       = (UserSession)Session["User"];
            HomeViewModel HViewModel = new HomeViewModel();

            Session["MenuItemNotif"] = HManager.GetMenuItemNotification(user.Username);
            Session["RawItemNotif"]  = HManager.GetRawItemNotification(user.Username);
            Session["VendorNotif"]   = HManager.GetVendorItemNotification(user.Username);
            HViewModel.MenuItemNotif = HManager.GetMenuItemNotification(user.Username);
            HViewModel.RawItemNotif  = HManager.GetRawItemNotification(user.Username);
            HViewModel.VendorNotif   = HManager.GetVendorItemNotification(user.Username);
            AccountManager.LogDateTime(user.Username);
            return(View(HViewModel));
        }
Exemplo n.º 4
0
        // GET: Location
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // LOC -> Location
            // Refer to UserAccessSession
            if (UASession == null || !UASession.LOC)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("LOC", "HOME", "LOG");

            // Get all data stored in DB table
            LocationManager   LCNManager   = new LocationManager();
            LocationViewModel LCNViewModel = new LocationViewModel();

            LCNViewModel.LCList = LCNManager.GetLCN();
            if (LCNViewModel.LCList == null || LCNViewModel.LCList.Count() == 0)
            {
                LCNViewModel.LCList = new List <LocationViewModel>();
            }
            // return View with ViewModel
            return(View(LCNViewModel));
        }
Exemplo n.º 5
0
        public ActionResult Login(LoginViewModel credentials, string returnURL)
        {
            if (ModelState.IsValid)
            {
                AccountManager accMan = new AccountManager();

                if (accMan.CheckPassword(credentials.Username, credentials.Password))
                {
                    FormsAuthentication.SetAuthCookie(credentials.Username, false);
                    // Set User session
                    UserSession userSession = new UserSession();
                    userSession.Username = credentials.Username;
                    userSession.UserID   = accMan.GetUserID(credentials.Username);
                    Session["User"]      = userSession;
                    // Set User access
                    UserAccessSession UASession = new UserAccessSession();
                    Session["UserAccess"] = accMan.SetUserAccess(credentials.Username);
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", "The password or username supplied is incorrect");
                }
            }
            return(View());
        }
Exemplo n.º 6
0
        // GET: RegularPriceTier
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // TIP -> Price Tier
            // Refer to UserAccessSession
            if (UASession == null || !UASession.TIP)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("TIP_REG", "HOME", "LOG");

            // Get all data stored in DB table
            RegularPriceTierManager   RPTManager   = new RegularPriceTierManager();
            RegularPriceTierViewModel RPTViewModel = new RegularPriceTierViewModel();

            RPTViewModel.RegPTList = RPTManager.GetRPT();
            if (RPTViewModel.RegPTList == null || RPTViewModel.RegPTList.Count() == 0)
            {
                RPTViewModel.RegPTList = new List <RegularPriceTierViewModel>();
            }
            // return View with ViewModel
            return(View(RPTViewModel));
        }
Exemplo n.º 7
0
        // GET: ProfitCenter
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // LOC -> ProfitCenter
            // Refer to UserAccessSession
            if (UASession == null || !UASession.PRC)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("PRC", "HOME", "LOG");

            // Get all data stored in DB table
            ProfitCenterManager   PRCManager   = new ProfitCenterManager();
            ProfitCenterViewModel PRCViewModel = new ProfitCenterViewModel();

            PRCViewModel.PCList = PRCManager.GetPRC();
            if (PRCViewModel.PCList == null || PRCViewModel.PCList.Count() == 0)
            {
                PRCViewModel.PCList = new List <ProfitCenterViewModel>();
            }
            // return View with ViewModel
            return(View(PRCViewModel));
        }
        // GET: ProjectGoldPriceTier
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // TIP -> Price Tier
            // Refer to UserAccessSession
            if (UASession == null || !UASession.TIP)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("TIP_GOL", "HOME", "LOG");

            // Get all data stored in DB table
            ProjectGoldPriceTierManager   PGTManager   = new ProjectGoldPriceTierManager();
            ProjectGoldPriceTierViewModel PGTViewModel = new ProjectGoldPriceTierViewModel();

            PGTViewModel.PrjPTList = PGTManager.GetPGT();
            if (PGTViewModel.PrjPTList == null || PGTViewModel.PrjPTList.Count() == 0)
            {
                PGTViewModel.PrjPTList = new List <ProjectGoldPriceTierViewModel>();
            }
            // return View with ViewModel
            return(View(PGTViewModel));
        }
Exemplo n.º 9
0
        // GET: MDSPriceTier
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // TIP -> Price Tier
            // Refer to UserAccessSession
            if (UASession == null || !UASession.TIP)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("TIP_MDS", "HOME", "LOG");

            // Get all data stored in DB table
            MDSPriceTierManager   MDSManager   = new MDSPriceTierManager();
            MDSPriceTierViewModel MDSViewModel = new MDSPriceTierViewModel();

            MDSViewModel.MDPTList = MDSManager.GetMDS();
            if (MDSViewModel.MDPTList == null || MDSViewModel.MDPTList.Count() == 0)
            {
                MDSViewModel.MDPTList = new List <MDSPriceTierViewModel>();
            }
            // return View with ViewModel
            return(View(MDSViewModel));
        }
        // GET: BusinessExtension
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            // BUE -> Business Extension
            // Refer to UserAccessSession
            if (UASession == null || !UASession.BUE)
            {
                return(RedirectToAction("Login", "Account"));
            }

            user = (UserSession)Session["User"];
            Session["CurrentPage"] = new CurrentPageSession("BUE", "HOME", "LOG");

            // Get all data stored in DB table
            BusinessExtensionManager   BEXManager   = new BusinessExtensionManager();
            BusinessExtensionViewModel BEXViewModel = new BusinessExtensionViewModel();

            BEXViewModel.BusinessExtList = BEXManager.GetBEX();
            if (BEXViewModel.BusinessExtList == null || BEXViewModel.BusinessExtList.Count() == 0)
            {
                BEXViewModel.BusinessExtList = new List <BusinessExtensionViewModel>();
            }
            // return View with ViewModel
            return(View(BEXViewModel));
        }
Exemplo n.º 11
0
        public UserAccessSession SetUserAccess(string username)
        {
            bool[]            UAArray   = GetUserAccessArray(username);
            UserAccessSession UASession = new UserAccessSession();

            UASession.MIM = UAArray[0];
            UASession.RIM = UAArray[1];
            UASession.MER = UAArray[2];
            UASession.STP = UAArray[3];
            UASession.SCM = UAArray[4];
            UASession.VEM = UAArray[5];
            UASession.VAM = UAArray[6];
            UASession.UAP = UAArray[7];
            UASession.MIP = UAArray[8];
            UASession.RIP = UAArray[9];
            UASession.AUL = UAArray[10];
            UASession.REG = UAArray[11];
            UASession.TEG = UAArray[12];
            UASession.TIP = UAArray[13];
            UASession.BUE = UAArray[14];
            UASession.OWN = UAArray[15];
            UASession.PRC = UAArray[16];
            UASession.LOC = UAArray[17];
            UASession.GRP = UAArray[18];
            return(UASession);
        }
        // GET: ReportGeneration
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.REG)
            {
                return(RedirectToAction("Login", "Account"));
            }

            Session["CurrentPage"] = new CurrentPageSession("REG", "HOME", "LOG");

            return(View(new ReportGenerationViewModel()));
        }
Exemplo n.º 13
0
        // GET: TextGenerator
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.TEG)
            {
                return(RedirectToAction("Login", "Account"));
            }

            Session["CurrentPage"] = new CurrentPageSession("TEG", "HOME", "LOG");
            TextGeneratorViewModel TGViewModel = new TextGeneratorViewModel();

            TGViewModel.IncludeAll = true;
            return(View(TGViewModel));
        }
Exemplo n.º 14
0
        public ActionResult CreateAccount()
        {   // Validate log in and user access
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.UAP)
            {
                return(RedirectToAction("Login", "Account"));
            }

            Session["CurrentPage"] = new CurrentPageSession("UAP_CREATE", "HOME", "LOG");
            AccountViewModel AViewModel = new AccountViewModel();
            AccountManager   AManager   = new AccountManager();

            AViewModel.AccountList = AManager.SearchAccounts("ALL");
            return(View(AViewModel));
        }
Exemplo n.º 15
0
        public ActionResult EditAccess()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.UAP)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("UAP_ACCESS_EDIT", "HOME", "LOG");

            AccountManager   AManager   = new AccountManager();
            AccountViewModel AViewModel = new AccountViewModel();

            AViewModel.AccountList = AManager.SearchAccounts("ALL");
            return(View(AViewModel));
        }
        /*
         * Default method.
         * TempData is used to store the ViewModel after a Search action.
         */
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.MIM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("MIP", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            MenuItemMasterViewModel MIMViewModel = new MenuItemMasterViewModel();

            MIMViewModel.MenuItemMasterList = MenuItemMasterManager.SearchMenuItems("ALL");
            return(View(MIMViewModel));
        }
Exemplo n.º 17
0
        // GET: AuditLog
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.AUL)
            {
                return(RedirectToAction("Login", "Account"));
            }

            Session["CurrentPage"] = new CurrentPageSession("AUL", "HOME", "LOG");

            AuditLogViewModel        ULViewModel = new AuditLogViewModel();
            AuditLogManager          ALManager   = new AuditLogManager();
            List <AuditLogViewModel> ALList      = ALManager.GetAuditLog();

            ViewData["ModelList"] = ALList;
            return(View());
        }
Exemplo n.º 18
0
        // GET: ValueMeal
        public ActionResult Index(string id)
        {
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.SCM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("SCM", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            SCMRecipeViewModel SCMViewModel = new SCMRecipeViewModel();

            if (id != null)
            {
                SCMViewModel = SCMRecipeManager.SearchSCMRecipe(id);
            }
            return(View(SCMViewModel));
        }
Exemplo n.º 19
0
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.GRP)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("GRP_RIM", "HOME", "LOG");


            ItemGroupViewModel IGViewModel = new ItemGroupViewModel();

            IGViewModel.GroupType    = 2;
            IGViewModel.RawItemList  = ItemGroupManager.GetFilteredRawItem();
            IGViewModel.AllStoreList = ItemGroupManager.GetFilteredStore();
            IGViewModel.GroupList    = ItemGroupManager.GetGroup(IGViewModel);
            return(View(IGViewModel));
        }
Exemplo n.º 20
0
        /*
         * Default method.
         * TempData is used to store the ViewModel after a Search action.
         */
        public ActionResult Index(string id)
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.VEM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("VEM", "HOME", "LOG");

            // Initialize page
            VendorMasterViewModel VMViewModel = new VendorMasterViewModel();

            if (id != null)
            {
                VMViewModel = VendorMasterManager.SearchSingleVendor(id);
            }
            VMViewModel.VendorMasterList = VendorMasterManager.SearchVendors("ALL");
            return(View(VMViewModel));
        }
Exemplo n.º 21
0
        /*
         * Default method.
         * TempData is used to store the ViewModel after a Search action.
         */
        public ActionResult Index(string id)
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.RIM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("RIM", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            RawItemMasterViewModel RIMViewModel = new RawItemMasterViewModel();

            if (id != null)
            {
                RIMViewModel = RawItemMasterManager.SearchSingleRawItem(id);
            }
            RIMViewModel.RawItemMasterList = RawItemMasterManager.GetRawItems("ALL");
            return(View(RIMViewModel));
        }
Exemplo n.º 22
0
        // GET: ValueMeal
        public ActionResult Index(string id)
        {
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.VAM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("VAM", "HOME", "LOG");

            ValueMealManager   VMManager   = new ValueMealManager();
            ValueMealViewModel VMViewModel = new ValueMealViewModel();

            if (id != null)
            {
                VMViewModel = VMManager.SearchSingleValueMeal(id);
                VMViewModel.ValueMealList = new List <ValueMeal>();
            }
            VMViewModel.ValueMealList = VMManager.SearchValueMeals("ALL");
            return(View(VMViewModel));
        }
Exemplo n.º 23
0
        // GET: StoreProfile
        public ActionResult Index(string id)
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.STP)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("STP", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            StoreProfileManager   SPManager   = new StoreProfileManager();
            StoreProfileViewModel SPViewModel = new StoreProfileViewModel();

            if (id != null)
            {
                SPViewModel = SPManager.SearchSingleStore(id);
            }
            SPViewModel.StoreList = SPManager.SearchStores("ALL");
            return(View(SPViewModel));
        }
Exemplo n.º 24
0
        /*
         * Default method.
         * TempData is used to store the ViewModel after a Search action.
         */
        public ActionResult Index(string id)
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.MIM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("MIM", "HOME", "LOG");

            // Initialize page
            MenuItemMasterViewModel MIMViewModel = new MenuItemMasterViewModel();

            if (id != null)
            {
                MIMViewModel = MenuItemMasterManager.SearchSingleMenuItem(id);
            }
            MIMViewModel.MenuItemMasterList = new List <MenuItem>();
            MIMViewModel.MenuItemMasterList = MenuItemMasterManager.SearchMenuItems("ALL");
            return(View(MIMViewModel));
        }
Exemplo n.º 25
0
        // GET: MenuRecipe
        public ActionResult Index(string id)
        {
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.MER)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("MER", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            MenuRecipeViewModel MRViewModel = new MenuRecipeViewModel();

            if (id != null)
            {
                MRViewModel             = MenuRecipeManager.SearchMenuRecipe(id);
                MRViewModel.HasSearched = true;
            }
            MRViewModel.MenuItemList = MenuRecipeManager.SearchMenuItem("ALL");
            MRViewModel.RawItemList  = RawItemMasterManager.GetRawItems("ALL");
            return(View(MRViewModel));
        }
        /*
         * Default method.
         * TempData is used to store the ViewModel after a Search action.
         */
        public ActionResult Index()
        {
            // Validate log in and user access
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.RIP)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("RIP", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            RawItemPriceUpdateViewModel RIPViewModel = (RawItemPriceUpdateViewModel)TempData["SearchItemSelected"];

            if (RIPViewModel == null)
            {
                RIPViewModel = new RawItemPriceUpdateViewModel();
            }
            RIPViewModel.SearchItem             = "ALL";
            RIPViewModel.RawItemPriceMasterList = RawItemPriceManager.SearchRawItemPrice(RIPViewModel);
            return(View(RIPViewModel));
        }