Exemplo n.º 1
0
        public ActionResult login()
        {
            Employee employee = new Employee();

            EmployeeLoginQuery.populateCustomerList(employee);

            foreach (var c in employee.cList)
            {
                CustomerLoginQuerys.populateRequests(c);
                CustomerLoginQuerys.populateServices(c);
            }

            return(View("EmployeeLoggedIn", employee));
        }
Exemplo n.º 2
0
        //VERIFIES LOGIN INFORMATION AND POPULATES PROFILES
        public ActionResult LoggedIn(string Login, string Password)
        {
            customer = new Customer_info();

            CustomerLoginQuerys.customerLogin(Login, Password, customer);
            CustomerLoginQuerys.populateRequests(customer);
            CustomerLoginQuerys.populateServices(customer);

            //if login fails
            if (customer.FName == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            ViewBag.CustomerID = customer.ID;
            ViewBag.Login      = customer.Login;
            ViewBag.Password   = customer.Password;
            return(View("LoggedIn", customer));
        }
Exemplo n.º 3
0
        public IActionResult Submit(IFormCollection collection)
        {
            string vid   = Request.Form["vid"];
            string notes = Request.Form["ServiceNotes"];

            string[] list = Service.getServiceList();

            foreach (var x in list)
            {
                Debug.WriteLine(notes + " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
                if (collection.ContainsKey(x) && collection[x] != "false")
                {
                    EmployeeQuerys.UpdateServices(vid, x, true);
                }
                else if (collection.ContainsKey(x) && collection[x] == "false")
                {
                    EmployeeQuerys.UpdateServices(vid, x, false);
                }
            }

            if (notes != null && notes != "" && notes != " ")
            {
                EmployeeQuerys.UpdateRequestNotes(vid, notes);
            }

            Employee employee = new Employee();

            EmployeeLoginQuery.populateCustomerList(employee);

            foreach (var c in employee.cList)
            {
                CustomerLoginQuerys.populateRequests(c);
                CustomerLoginQuerys.populateServices(c);
            }

            return(View("EmployeeLoggedIn", employee));
        }