MvcApplication2/Controllers/EmployeeController.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using MvcApplication2.Bussiness;
using MvcApplication2.Filters;
using MvcApplication2.Models;
using MvcApplication2.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication2.Controllers
{
    public class EmployeeController : Controller
    {
        //
        // GET: /Test/
        [Authorize]
        [HeaderFooterFilter]
        public ActionResult Index()
        {
            return GetView();
        }

        public ActionResult GetView()
        {
            EmployeeBusinessLayer embuss=new EmployeeBusinessLayer();
            EmployeeListViewModel emlist = new EmployeeListViewModel();
           // emlist.UserName =User.Identity.Name;
            List<Employee> emli= embuss.GetEmployee();
            List<EmployeeViewModel> list = new List<EmployeeViewModel>();
            foreach (Employee em in emli)
            {
                EmployeeViewModel emvm = new EmployeeViewModel();
                emvm.EmployeeName = em.FirstName + em.LastName;
                emvm.EmpID = em.EmployeeID.ToString();
                emvm.Salary = em.Salary;
                if (emvm.Salary > 100)
                {
                    emvm.SalaryColor = "green";
                }
                else
                {
                    emvm.SalaryColor = "yellow";
                }
                list.Add(emvm);
            }
            emlist.list = list;
         
            return View("Index", emlist);
        }
        public string empID = "";
            [AdminFilter]
        [HeaderFooterFilter]
        public ActionResult DeleteEmployeess()
        {
             empID = Request["data"].ToString();
             ViewData["empid"] = empID;
            return View("DeleteEm");
        }
      
后面还有 57 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。