2022-03-15 17:36:38 +08:00
|
|
|
|
using EmitMapper;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
{
|
|
|
|
|
public static class APIUserService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取用户登录信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userInfo"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.UserItem UserLogOn(Model.UserItem userInfo)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var getUser = db.View_Sys_User.FirstOrDefault(x => (x.Account == userInfo.Account || x.Telephone == userInfo.Telephone) && x.IsPost == true && x.Password == Funs.EncryptionPassword(userInfo.Password));
|
|
|
|
|
return ObjectMapperManager.DefaultInstance.GetMapper<Model.View_Sys_User, Model.UserItem>().Map(getUser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据userId获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.UserItem getUserByUserId(string userId)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var getUser = db.View_Sys_User.FirstOrDefault(x => x.UserId == userId);
|
|
|
|
|
return ObjectMapperManager.DefaultInstance.GetMapper<Model.View_Sys_User, Model.UserItem>().Map(getUser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据unitid获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="unitid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.BaseInfoItem> getUserByUnitId(string unitId, string strParam)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var getUser = (from x in db.Sys_User
|
|
|
|
|
join y in db.Sys_Role on x.RoleId equals y.RoleId
|
|
|
|
|
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.UserName.Contains(strParam))
|
|
|
|
|
orderby x.UserName
|
|
|
|
|
select new Model.BaseInfoItem { BaseInfoId = x.UserId, BaseInfoName = x.UserName, BaseInfoCode = x.Telephone }).ToList();
|
|
|
|
|
|
|
|
|
|
return getUser;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据projectId、unitid获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="projectId"></param>
|
|
|
|
|
/// <param name="unitId"></param>
|
|
|
|
|
/// <param name="strParam"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.UserItem> getUserByProjectIdUnitIdQuery(string projectId, string unitId, string roleIds, string strParam)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
List<Model.UserItem> getDataList = new List<Model.UserItem>();
|
|
|
|
|
HashSet<string> userid = new HashSet<string>();
|
|
|
|
|
List<string> roleList = Funs.GetStrListByStr(roleIds, ',');
|
|
|
|
|
if (!string.IsNullOrEmpty(projectId))
|
|
|
|
|
{
|
|
|
|
|
var templist = (from x in db.Sys_User
|
|
|
|
|
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
|
|
|
|
where y.ProjectId == projectId && (x.UnitId == unitId || unitId == null)
|
|
|
|
|
&& (strParam == null || x.UserName.Contains(strParam))
|
|
|
|
|
select new Model.UserItem
|
|
|
|
|
{
|
|
|
|
|
UserId = x.UserId,
|
|
|
|
|
Account = x.Account,
|
|
|
|
|
UserCode = x.UserCode,
|
|
|
|
|
Password = x.Password,
|
|
|
|
|
UserName = x.UserName,
|
|
|
|
|
RoleId = y.RoleId,
|
|
|
|
|
RoleName = RoleService.getRoleNamesRoleIds(y.RoleId),
|
|
|
|
|
UnitId = y.UnitId,
|
|
|
|
|
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName,
|
|
|
|
|
LoginProjectId = y.ProjectId,
|
|
|
|
|
LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
Email = x.Email,
|
|
|
|
|
Telephone = x.Telephone,
|
|
|
|
|
IsOffice = x.IsOffice,
|
|
|
|
|
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
|
|
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var item in templist)
|
|
|
|
|
{
|
|
|
|
|
if (roleList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var role in roleList)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (item.RoleId.IndexOf(role) >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (!userid.Contains(item.UserId))
|
|
|
|
|
{
|
|
|
|
|
getDataList.Add(item);
|
|
|
|
|
userid.Add(item.UserId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!userid.Contains(item.UserId))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
getDataList.Add(item);
|
|
|
|
|
userid.Add(item.UserId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var templist = (from x in db.Sys_User
|
|
|
|
|
where x.IsPost == true && (x.UnitId == unitId || unitId == null)
|
|
|
|
|
&& (strParam == null || x.UserName.Contains(strParam))
|
|
|
|
|
select new Model.UserItem
|
|
|
|
|
{
|
|
|
|
|
UserId = x.UserId,
|
|
|
|
|
Account = x.Account,
|
|
|
|
|
UserCode = x.UserCode,
|
|
|
|
|
Password = x.Password,
|
|
|
|
|
UserName = x.UserName,
|
|
|
|
|
RoleId = x.RoleId,
|
|
|
|
|
RoleName = db.Sys_Role.First(z => z.RoleId == x.RoleId).RoleName,
|
|
|
|
|
UnitId = x.UnitId,
|
|
|
|
|
UnitName = db.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName,
|
|
|
|
|
//LoginProjectId = y.ProjectId,
|
|
|
|
|
//LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
Email = x.Email,
|
|
|
|
|
Telephone = x.Telephone,
|
|
|
|
|
IsOffice = x.IsOffice,
|
|
|
|
|
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
|
|
|
|
|
}).ToList();
|
|
|
|
|
foreach (var item in templist)
|
|
|
|
|
{
|
|
|
|
|
if (roleList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var role in roleList)
|
|
|
|
|
{
|
|
|
|
|
if (item.RoleId.IndexOf(role) >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (!userid.Contains(item.UserId))
|
|
|
|
|
{
|
|
|
|
|
getDataList.Add(item);
|
|
|
|
|
userid.Add(item.UserId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!userid.Contains(item.UserId))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
getDataList.Add(item);
|
|
|
|
|
userid.Add(item.UserId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.UserName).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据单位类型获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="projectId"></param>
|
|
|
|
|
/// <param name="unitType"></param>
|
|
|
|
|
/// <param name="strParam"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.UserItem> getUserByProjectIdUnitTypeQuery(string projectId, string unitType, string roleIds, string strParam)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
List<Model.UserItem> getDataList = new List<Model.UserItem>();
|
|
|
|
|
List<string> roleList = Funs.GetStrListByStr(roleIds, ',');
|
|
|
|
|
getDataList = (from x in db.Sys_User
|
|
|
|
|
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
|
|
|
|
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
|
|
|
|
|
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType
|
|
|
|
|
&& (roleIds == null || roleList.Contains(y.RoleId)) && (strParam == null || x.UserName.Contains(strParam))
|
|
|
|
|
select new Model.UserItem
|
|
|
|
|
{
|
|
|
|
|
UserId = x.UserId,
|
|
|
|
|
Account = x.Account,
|
|
|
|
|
UserCode = x.UserCode,
|
|
|
|
|
Password = x.Password,
|
|
|
|
|
UserName = x.UserName,
|
|
|
|
|
RoleId = y.RoleId,
|
|
|
|
|
RoleName = RoleService.getRoleNamesRoleIds(y.RoleId),
|
|
|
|
|
UnitId = y.UnitId,
|
|
|
|
|
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName,
|
|
|
|
|
LoginProjectId = y.ProjectId,
|
|
|
|
|
LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
|
|
|
|
|
IdentityCard = x.IdentityCard,
|
|
|
|
|
Email = x.Email,
|
|
|
|
|
Telephone = x.Telephone,
|
|
|
|
|
IsOffice = x.IsOffice,
|
|
|
|
|
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.UserName).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取所有在岗用户
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static List<Model.UserItem> UserLogOn2()
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var user = from x in db.Sys_User
|
|
|
|
|
where x.IsPost == true
|
|
|
|
|
select x;
|
|
|
|
|
return ObjectMapperManager.DefaultInstance.GetMapper<List<Model.Sys_User>, List<Model.UserItem>>().Map(user.ToList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据userId获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static void getSaveUserTel(string userId, string tel)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId);
|
|
|
|
|
if (getUser != null)
|
|
|
|
|
{
|
|
|
|
|
getUser.Telephone = tel;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据userId获取用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static void getSaveUserSignatureUrl(string userId, string SignatureUrl)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId);
|
|
|
|
|
if (getUser != null)
|
|
|
|
|
{
|
|
|
|
|
getUser.SignatureUrl = SignatureUrl;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取人员未浏览记录数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="unitid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int getMenuUnreadCount(string menuId, string projectId, string userId)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
int count = 0;
|
|
|
|
|
var readCount = db.Sys_UserRead.Where(x => x.MenuId == menuId && x.ProjectId == projectId && x.UserId == userId).Select(x => x.DataId).Distinct().Count();
|
|
|
|
|
if (menuId == Const.ProjectNoticeMenuId)
|
|
|
|
|
{
|
|
|
|
|
var noticeCount = db.InformationProject_Notice.Where(x => x.AccessProjectId.Contains(projectId) && x.IsRelease == true).Count();
|
|
|
|
|
count = noticeCount - readCount;
|
|
|
|
|
}
|
|
|
|
|
count = count < 0 ? 0 : count;
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存浏览记录
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="unitid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static void getSaveUserRead(string menuId, string projectId, string userId, string dataId)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
var userRead = db.Sys_UserRead.FirstOrDefault(x => x.ProjectId == projectId && x.UserId == userId && x.DataId == dataId);
|
|
|
|
|
if (userRead == null)
|
|
|
|
|
{
|
|
|
|
|
Model.Sys_UserRead newRead = new Model.Sys_UserRead
|
|
|
|
|
{
|
|
|
|
|
UserReadId = SQLHelper.GetNewID(),
|
|
|
|
|
UserId = userId,
|
|
|
|
|
MenuId = menuId,
|
|
|
|
|
ProjectId = projectId,
|
|
|
|
|
DataId = dataId,
|
|
|
|
|
ReadTime = DateTime.Now,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
db.Sys_UserRead.InsertOnSubmit(newRead);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-25 10:12:47 +08:00
|
|
|
|
|
|
|
|
|
#region 保存Meeting
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存Meeting
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="meeting">会议信息</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string SaveUserInfo(Model.UserListItem listItem)
|
|
|
|
|
{
|
|
|
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
|
|
|
{
|
|
|
|
|
List<Model.UserItem> userInfo = listItem.list;
|
|
|
|
|
string returnInfos = string.Empty;
|
|
|
|
|
int i = 0;
|
|
|
|
|
int rowNum = 0;
|
|
|
|
|
foreach (var item in userInfo)
|
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
string info = string.Empty;
|
|
|
|
|
if (string.IsNullOrEmpty(item.UnitName))
|
|
|
|
|
{
|
|
|
|
|
info += "单位名称为空。";
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(item.UserName))
|
|
|
|
|
{
|
|
|
|
|
info += "用户名称为空。";
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(item.Account))
|
|
|
|
|
{
|
|
|
|
|
info += "用户账号为空。";
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(info))
|
|
|
|
|
{
|
|
|
|
|
Model.Sys_User newUser = new Model.Sys_User
|
|
|
|
|
{
|
|
|
|
|
UserId = item.UserId,
|
|
|
|
|
UserCode = item.UserCode,
|
|
|
|
|
UserName = item.UserName,
|
|
|
|
|
Account = item.Account,
|
|
|
|
|
Password = item.Password,
|
|
|
|
|
IdentityCard = item.IdentityCard,
|
|
|
|
|
Telephone = item.Telephone,
|
|
|
|
|
IsPost = item.IsPost == "1" ? true : false,
|
|
|
|
|
IsOffice = true,
|
|
|
|
|
};
|
|
|
|
|
#region 用户单位
|
|
|
|
|
newUser.UnitId = Const.UnitId_CD;
|
|
|
|
|
if (!string.IsNullOrEmpty(item.UnitName) || !string.IsNullOrEmpty(item.UnitCode))
|
|
|
|
|
{
|
|
|
|
|
var getUnit = db.Base_Unit.FirstOrDefault(x => x.UnitName == item.UnitName || x.UnitName == item.UnitName);
|
|
|
|
|
if (getUnit != null)
|
|
|
|
|
{
|
|
|
|
|
newUser.UnitId = getUnit.UnitId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Model.Base_Unit newUnit = new Model.Base_Unit
|
|
|
|
|
{
|
|
|
|
|
UnitId = SQLHelper.GetNewID(),
|
|
|
|
|
UnitName = item.UnitName,
|
|
|
|
|
UnitCode = item.UnitCode,
|
|
|
|
|
};
|
|
|
|
|
db.Base_Unit.InsertOnSubmit(newUnit);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
newUser.UnitId = newUnit.UnitId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region 用户部门
|
|
|
|
|
if (!string.IsNullOrEmpty(item.DepartName))
|
|
|
|
|
{
|
|
|
|
|
var getDepart = db.Base_Depart.FirstOrDefault(x => x.DepartName == item.DepartName);
|
|
|
|
|
if (getDepart != null)
|
|
|
|
|
{
|
|
|
|
|
newUser.DepartId = getDepart.DepartId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Model.Base_Depart newDepart = new Model.Base_Depart
|
|
|
|
|
{
|
|
|
|
|
DepartId = SQLHelper.GetNewID(),
|
|
|
|
|
DepartName = item.DepartName,
|
|
|
|
|
};
|
|
|
|
|
db.Base_Depart.InsertOnSubmit(newDepart);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
newUser.DepartId = newDepart.DepartId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region 用户角色
|
|
|
|
|
if (!string.IsNullOrEmpty(item.RoleName))
|
|
|
|
|
{
|
|
|
|
|
var getRole = db.Sys_Role.FirstOrDefault(x => x.RoleName == item.RoleName);
|
|
|
|
|
if (getRole != null)
|
|
|
|
|
{
|
|
|
|
|
newUser.RoleId = getRole.RoleId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Model.Sys_Role newRole = new Model.Sys_Role
|
|
|
|
|
{
|
|
|
|
|
RoleId = SQLHelper.GetNewID(),
|
|
|
|
|
RoleName = item.RoleName,
|
|
|
|
|
};
|
|
|
|
|
db.Sys_Role.InsertOnSubmit(newRole);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
newUser.RoleId = newRole.RoleId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
if (!string.IsNullOrEmpty(item.Password))
|
|
|
|
|
{
|
|
|
|
|
newUser.Password = item.Password;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newUser.Password = Funs.EncryptionPassword(Const.Password);
|
|
|
|
|
}
|
|
|
|
|
var geUser = db.Sys_User.FirstOrDefault(x => (x.Account == item.Account && item.Account != null) || (x.IdentityCard == item.IdentityCard && item.IdentityCard != null));
|
|
|
|
|
if (geUser != null)
|
|
|
|
|
{
|
|
|
|
|
geUser.UserCode = newUser.UserCode;
|
|
|
|
|
geUser.UserName = newUser.UserName;
|
|
|
|
|
geUser.Account = newUser.Account;
|
|
|
|
|
geUser.Password = newUser.Password;
|
|
|
|
|
geUser.IdentityCard = newUser.IdentityCard;
|
|
|
|
|
geUser.Telephone = newUser.Telephone;
|
|
|
|
|
geUser.UnitId = newUser.UnitId;
|
|
|
|
|
geUser.DepartId = newUser.DepartId;
|
|
|
|
|
geUser.RoleId = newUser.RoleId;
|
|
|
|
|
geUser.IsPost = newUser.IsPost;
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newUser.UserId = SQLHelper.GetNewID();
|
|
|
|
|
db.Sys_User.InsertOnSubmit(newUser);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
rowNum++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
returnInfos += "第" + i.ToString() + "行," + info;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(returnInfos))
|
|
|
|
|
{
|
|
|
|
|
returnInfos = "同步成功" + rowNum.ToString() + "条记录。" + returnInfos;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
returnInfos = "同步成功" + rowNum.ToString() + "条记录。";
|
|
|
|
|
}
|
|
|
|
|
return returnInfos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2022-03-15 17:36:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|