Exemple #1
0
        public ActionResult Delete(int id)
        {
            BL_ComplainantsDetail bL_ComplainantsDetail = new BL_ComplainantsDetail();
            bL_ComplainantsDetail.DeleteComplainant(id);

            return RedirectToAction("AllComplainantsDetail");
        }
Exemple #2
0
        public ActionResult AllComplainantsDetail()
        {
            BL_ComplainantsDetail bL_ComplainantsDetail = new BL_ComplainantsDetail();

            List<ComplainantsDetail> ComplainantsDetail_List = bL_ComplainantsDetail.ComplainantsDetails.ToList();
            return View(ComplainantsDetail_List);
        }
Exemple #3
0
        [ActionName("Create")]//=>reposnd on  .../complainants/create either we change its name(part#15)
        public ActionResult Create_Post()
        {
            ComplainantsDetail complainantsDetail = new ComplainantsDetail();
            TryUpdateModel(complainantsDetail);

            if (ModelState.IsValid)
            {

                BL_ComplainantsDetail bL_ComplainantsDetail = new BL_ComplainantsDetail();
                bL_ComplainantsDetail.InsertComplainantsDetails(complainantsDetail);

                return RedirectToAction("AllComplainantsDetail");
            }
            return View();

        }
Exemple #4
0
        public ActionResult Login_Post()
        {
            LogIn logIn = new LogIn();

            TryUpdateModel(logIn);

            if (ModelState.IsValid)
            {
                BL_ComplainantsDetail     bL_ComplainantsDetail = new BL_ComplainantsDetail();
                List <ComplainantsDetail> ComplainantsDetails   = bL_ComplainantsDetail.ComplainantsDetails.ToList();

                foreach (var user in ComplainantsDetails.ToList())
                {
                    if (user.Email == logIn.Email && user.UserPassword == logIn.Password)
                    {
                        Session[user.AccountType] = true;
                        return(RedirectToAction("Create", "Complains"));
                    }
                }

                BL_Employees    bL_Employees = new BL_Employees();
                List <Employee> employees    = bL_Employees.Employees.ToList();

                foreach (var employee in employees.ToList())
                {
                    if (logIn.Email == employee.Email && logIn.Password == employee.EmployeePassword && employee.AccountType == "Admin")
                    {
                        Session[employee.AccountType] = true;
                        return(RedirectToAction("Admin_Index", "Admin"));
                    }
                    else if (employee.Email == logIn.Email && employee.EmployeePassword == logIn.Password)
                    {
                        Session[employee.AccountType] = true;
                        if (employee.AccountType == "ASI")
                        {
                            return(RedirectToAction("ComplainsByStationName/" + (employee.StationName) + "", "Complains"));
                        }
                    }
                }
            }

            ViewBag.Error = "Incorrect username or password!";
            return(View());
        }