//APPROVE
        public ActionResult Approve(int id)
        {
            ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "First_Name");
            SouvenirRequestViewModel model = SouvenirRequestRepo.GetById(id);

            return(PartialView("_Approve", model));
        }
示例#2
0
 // GET: User
 public ActionResult Index()
 {
     ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "FullName", "FullName");
     ViewBag.Role     = new SelectList(RoleRepo.Get(), "Name", "Name");
     ViewBag.Company  = new SelectList(CompanyRepo.Get(), "Name", "Name");
     return(View(UserRepo.Get()));
 }
        //View Approve
        public ActionResult Approve(int id)
        {
            PromotionViewModel model = PromotionRepo.GetById(id);

            ViewBag.Employee = new SelectList(PromotionRepo.GetStaff(), "Id", "Full_Name");
            UserViewModel currentuser = PromotionRepo.GetIdByName(User.Identity.Name);

            if (model.FlagDesign == "Yes")
            {
                return(PartialView("_Approve", model));
            }
            else
            {
                return(PartialView("_ApproveNo", model));
            }

            if (currentuser.Role == "Admin")
            {
                ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "FullName");
                return(PartialView("_Approve", PromotionRepo.GetById(id)));
            }
            else
            {
                return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" })));
            }
        }
示例#4
0
        public ActionResult Edit(int id)
        {
            ViewBag.Role     = new SelectList(RoleRepo.Get(), "Id", "Name");
            ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "Fullname");
            UserViewModel model = UserRepo.GetById(id);

            return(PartialView("_Edit", model));
        }
示例#5
0
        static void EmployeeRepoTest()
        {
            var repo1 = new EmployeeRepo(ConnectionString, ProviderName);
            var emp   = repo1.Get(15);

            emp.FirstName = "Artrsiom";
            repo1.Update(emp);
            var statList  = repo1.GetStatByRegions();
            var stattList = repo1.GetEmplsWithShips();
            var sss       = repo1.GetWholeEntitiesList();
        }
示例#6
0
        public ActionResult Edit(int id)
        {
            var employee = EmployeeRepo.Get(id);

            var model = new EditEmployeeViewModel();

            model.FirstName    = employee.FirstName;
            model.LastName     = employee.LastName;
            model.DepartmentId = employee.DepartmentId;
            model.Phone        = employee.Phone;
            model.EmployeeId   = employee.EmployeeId;

            model.Departments = GetDepartmentSelectList();
            return(View(model));
        }
        //CLOSE DESIGN REQUEST POST
        public ActionResult Close(int id)
        {
            ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "First_Name");
            DesignApproveViewModel model  = DesignApproveRepo.GetById(id);
            UserViewModel          access = DesignApproveRepo.GetIdByName(User.Identity.Name);

            if (access.Role == "Staff" || access.Role == "Admin")
            {
                return(PartialView("_Close", model));
            }
            else
            {
                return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" })));
            }
        }
        public ActionResult Edit(int id)
        {
            UserViewModel result = UserRepo.GetIdByName(User.Identity.Name);

            ViewBag.Employee = new SelectList(EmployeeRepo.Get(), "Id", "First_Name");
            SouvenirStockViewModel model = SouvenirStockRepo.GetById(id);

            if (result.Role == "Staff" || result.Role == "Admin")
            {
                return(PartialView("_Edit", model));
            }
            else
            {
                return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" })));
            }
        }
示例#9
0
 //GET LIST
 public ActionResult List()
 {
     return(View("_List", EmployeeRepo.Get()));
 }
示例#10
0
 // GET api/<controller>
 public IEnumerable <EmployeeViewModel> Get()
 {
     return(EmployeeRepo.Get());
 }
示例#11
0
 // GET: Employee
 public ActionResult Index()
 {
     ViewBag.CompanyName = new SelectList(CompanyRepo.Get(), "Name", "Name");
     return(View(EmployeeRepo.Get()));
 }