BusinessLayer/EmployeeBusinessLayer.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using MvcApplication2.DataAccess;
using MvcApplication2.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MvcApplication2.Bussiness
{
public class EmployeeBusinessLayer
{
public List<Employee> GetEmployee()
{
List<Employee> employees = new List<Employee>();
SalesERPDAL salesDal = new SalesERPDAL();
return salesDal.Employees.ToList();
}
public Employee SaveEmployee(Employee e)
{
SalesERPDAL sale = new SalesERPDAL();
sale.Employees.Add(e);
sale.SaveChanges();
return e;
}
public bool DeleteEmployee(string empID)
{
bool flag = false;
SalesERPDAL sale = new SalesERPDAL();
int emp = Convert.ToInt32(empID);
Employee e= sale.Employees.FirstOrDefault(item => item.EmployeeID == emp);
sale.Employees.Remove(e);
int i = sale.SaveChanges();
if (i > 0)
{
flag = true;
}
return flag;
}
public bool IsValidUser(UserDetails u)
{
bool flag = false;
if (u.UserName == "Admin" && u.PassWord == "Admin")
{
return true;
}
else
{
return false;
}
}
public UserStatus GetUserValidity(UserDetails u)
{
if (u.UserName == "Admin" && u.PassWord == "Admin")
{
return UserStatus.AuthenticatedAdmin;
}
else if (u.UserName == "Sukesh" && u.PassWord == "Sukesh")
{
return UserStatus.AuthentucatedUser;
}
后面还有 14 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。