合并最新
This commit is contained in:
@@ -19,6 +19,11 @@ namespace BLL
|
||||
return Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartId == departId);
|
||||
}
|
||||
|
||||
public static Model.Base_Depart getDepartByDepartName(string name)
|
||||
{
|
||||
return Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartName == name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
return Funs.DB.Sys_Role.FirstOrDefault(x => x.RoleId == roleId);
|
||||
}
|
||||
|
||||
public static Model.Sys_Role getRoleByName(string roleName)
|
||||
{
|
||||
return Funs.DB.Sys_Role.FirstOrDefault(x => x.RoleName == roleName);
|
||||
}
|
||||
|
||||
public static string GetRoleTypeByRoleId(string roleId)
|
||||
{
|
||||
string type = string.Empty;
|
||||
|
||||
@@ -45,6 +45,19 @@ namespace BLL
|
||||
return (unit != null);
|
||||
}
|
||||
|
||||
public static Model.Base_Unit getUnitByCollCropCodeUnitName(string CollCropCode, string unitName)
|
||||
{
|
||||
var getUnit = Funs.DB.Base_Unit.FirstOrDefault(e => e.CollCropCode == CollCropCode);
|
||||
if (getUnit != null)
|
||||
{
|
||||
return getUnit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitName == unitName);
|
||||
}
|
||||
}
|
||||
|
||||
#region 单位信息维护
|
||||
/// <summary>
|
||||
/// 添加单位信息
|
||||
|
||||
@@ -28,6 +28,10 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.UserName == userName);
|
||||
}
|
||||
public static Model.Sys_User GetUserByAccount(string account)
|
||||
{
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.Account == account);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户项目上角色List
|
||||
@@ -192,7 +196,7 @@ namespace BLL
|
||||
public static void AddUser(Model.Sys_User user)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Sys_User));
|
||||
string newKeyID = SQLHelper.GetNewID();
|
||||
Model.Sys_User newUser = new Model.Sys_User
|
||||
{
|
||||
UserId = newKeyID,
|
||||
@@ -314,6 +318,26 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 修改员工信息
|
||||
/// </summary>
|
||||
/// <param name="user">人员实体</param>
|
||||
public static void UpdateUserInfo(Model.Sys_User user)
|
||||
{
|
||||
Model.Sys_User newUser = Funs.DB.Sys_User.FirstOrDefault(e => e.UserId == user.UserId);
|
||||
if (newUser != null)
|
||||
{
|
||||
newUser.Account = user.Account;
|
||||
newUser.UserName = user.UserName;
|
||||
newUser.UserCode = user.UserCode;
|
||||
newUser.IdentityCard = user.IdentityCard;
|
||||
newUser.Email = user.Email;
|
||||
newUser.Telephone = user.Telephone;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据人员Id删除一个人员信息
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user