public JsonResult inpormt(string categoryTable) { List <TF_PersonnelFile> listItem = JsonHelper.JSONToList <TF_PersonnelFile>(categoryTable); // int f = OPBiz.DelForSetDelete("Id", IDSet); HttpReSultMode ReSultMode = new HttpReSultMode(); foreach (TF_PersonnelFile file in listItem) { file.Id = Guid.NewGuid(); file.CreateMan = UserData.UserName; file.CreateTime = DateTime.Now; file.isValid = true; file.isDeleted = false; try { OPBiz.Add(file); ReSultMode.Code = 11; ReSultMode.Data = file.Id.ToString(); ReSultMode.Msg = "添加成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "人员档案库--导入", true, WebClientIP, "人员档案库"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "人员档案库--导入", false, WebClientIP, "人员档案库"); break; } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
/// <summary> /// //添加单按钮 /// </summary> /// <param name="btnId"></param> /// <param name="ManuId"></param> /// <returns></returns> public JsonResult AddManuBtn(string BtnId, string ManuId, string OrderNo) { var mql2 = RMS_MenuButtonsSet.SelectAll().Where(RMS_MenuButtonsSet.ButtonId.Equal(BtnId).And(RMS_MenuButtonsSet.ManuId.Equal(ManuId))); RMS_MenuButtons item = MBDBiz.GetEntity(mql2); if (item != null) { item.OrderNo = int.Parse(OrderNo); item.WhereExpression = RMS_MenuButtonsSet.Id.Equal(item.Id); // spmodel.GroupId = GroupId; if (MBDBiz.Update(item) > 0) { return(Json("OK", JsonRequestBehavior.AllowGet)); } } item = new RMS_MenuButtons(); item.Id = Guid.NewGuid(); item.ButtonId = Guid.Parse(BtnId); item.ManuId = Guid.Parse(ManuId); item.OrderNo = int.Parse(OrderNo); MBDBiz.Add(item); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "菜单管理--添加菜单按钮", true, WebClientIP, "菜单管理"); return(Json("OK", JsonRequestBehavior.AllowGet)); }
public JsonResult ReturnSign(string IDSet) { //int f //=0; var catmodle = OPBiz.GetEntity(TF_PersonnelFile_BorrowSet.SelectAll().Where(TF_PersonnelFile_BorrowSet.Id.Equal(IDSet))); catmodle.States = 2; catmodle.StatesName = "提交归还"; catmodle.ReturnTime = DateTime.Today.ToString(); catmodle.WhereExpression = TF_PersonnelFile_BorrowSet.Id.Equal(IDSet); var f = OPBiz.Update(catmodle); HttpReSultMode ReSultMode = new HttpReSultMode(); if (f > 0) { ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "提交成功!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.归还, "档案借用--归还", true, WebClientIP, "档案借用"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } else { ReSultMode.Code = -13; ReSultMode.Data = "0"; ReSultMode.Msg = "提交失败!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.归还, "档案借用--归还", false, WebClientIP, "档案借用"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } }
public JsonResult ChangeSignChangeSignadmin(string IDSet) { //int f //=0; var catmodle = OPBiz.GetEntity(TF_PersonnelFile_Transmitting_OutSet.SelectAll().Where(TF_PersonnelFile_Transmitting_OutSet.Id.Equal(IDSet))); catmodle.States = 1; catmodle.WhereExpression = TF_PersonnelFile_Transmitting_OutSet.Id.Equal(IDSet); var f = OPBiz.Update(catmodle); HttpReSultMode ReSultMode = new HttpReSultMode(); if (f > 0) { ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "提交成功!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.提交, "档案转出--提交", true, WebClientIP, "档案转出"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } else { ReSultMode.Code = -13; ReSultMode.Data = "0"; ReSultMode.Msg = "提交失败!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.提交, "档案转出--提交", false, WebClientIP, "档案转出"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// //添加转出单位 /// </summary> /// <param name="btnId"></param> /// <param name="ManuId"></param> /// <returns></returns> public JsonResult AddUnitsOut(string UnitsId, string PersonnelFileId) { HttpReSultMode ReSultMode = new HttpReSultMode(); var mql2 = TF_PersonnelFile_Units_OutSet.SelectAll().Where(TF_PersonnelFile_Units_OutSet.UnitsId.Equal(UnitsId).And(TF_PersonnelFile_Units_OutSet.PersonnelFileId.Equal(PersonnelFileId))); TF_PersonnelFile_Units_Out item = outOPBiz.GetEntity(mql2); if (item != null) { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "添加转出单位成功"; return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } item = new TF_PersonnelFile_Units_Out(); item.Id = Guid.NewGuid(); item.UnitsId = Guid.Parse(UnitsId); item.PersonnelFileId = Guid.Parse(PersonnelFileId); inOPBiz.Add(item); ReSultMode.Code = 11; ReSultMode.Data = item.Id.ToString();; ReSultMode.Msg = "添加转出单位成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配转出单位, "人员档案库--分配转出单位", true, WebClientIP, "人员档案库"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
public ActionResult LifeWebOfficeDoc() { ViewBag.ViewBag = Request["id"]; ViewBag.RuteUrl = RuteUrl(); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.查看文档, "查看原始文档", true, WebClientIP, "生平"); return(View()); }
public JsonResult EditInfo(TF_PersonnelFile_Consult EidModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { EidModle.Id = Guid.NewGuid(); EidModle.CreateMan = UserData.UserName; EidModle.CreateManId = UserData.Id; EidModle.CreateTime = DateTime.Now; EidModle.isDeleted = false; EidModle.States = 0; try { OPBiz.Add(EidModle); ReSultMode.Code = 11; ReSultMode.Data = EidModle.Id.ToString(); ReSultMode.Msg = "添加成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "档案查阅管理--新增", true, WebClientIP, "档案查阅"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "档案查阅管理--新增", false, WebClientIP, "档案查阅"); } } else { EidModle.WhereExpression = TF_PersonnelFile_ConsultSet.Id.Equal(EidModle.Id); // EidModle.ChangedMap.Remove("id");//移除主键值 if (OPBiz.Update(EidModle) > 0) { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "修改成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "档案查阅管理--修改", true, WebClientIP, "档案查阅"); } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "档案查阅管理--修改", false, WebClientIP, "档案查阅"); } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
public JsonResult GetLifeFiles(string id) { var mql = File_ImageSet.SelectAll().Where(File_ImageSet.ToId.Equal(id)); List <File_Image> list = new File_ImageBiz().GetOwnList(mql); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "生平管理--编辑/查看文档", true, WebClientIP, "生平管理"); return(Json(list, JsonRequestBehavior.AllowGet)); }
public JsonResult DeleteInfo(string ID) { var mql2 = RMS_RoleSet.Id.Equal(ID); int f = RDBiz.Remove <RMS_RoleSet>(mql2); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.除, "角色管理--删除", true, WebClientIP, "角色管理"); return(Json("OK", JsonRequestBehavior.AllowGet)); }
public JsonResult EditInfo(TF_EntryAndExitRegistration EidModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; EidModle.UpdateTime = DateTime.Now; if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } //if (IsAdd) //{ // EidModle.Id = Guid.NewGuid(); // EidModle.CreateMan = UserData.UserName; // EidModle.CreateTime = DateTime.Now; // EidModle.isValid = true; // EidModle.isDeleted = false; // EidModle.ApprovalStates = -1; // try // { // OPBiz.Add(EidModle); // ReSultMode.Code = 11; // ReSultMode.Data = EidModle.Id.ToString(); // ReSultMode.Msg = "添加成功"; // } // catch (Exception e) // { // ReSultMode.Code = -11; // ReSultMode.Data = e.ToString(); // ReSultMode.Msg = "添加失败"; // } //} //else //{ EidModle.WhereExpression = TF_EntryAndExitRegistrationSet.Id.Equal(EidModle.Id); // EidModle.ChangedMap.Remove("id");//移除主键值 if (OPBiz.Update(EidModle) > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "证件审核--修改", true, WebClientIP, "证件审核"); ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "修改成功"; } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; } //} return Json(ReSultMode, JsonRequestBehavior.AllowGet); }
public string SaveRoleOP(string RoleManus, string RoleManuButtons, string RoleId) { Guid roleid = Guid.Parse(RoleId); List <string> manu = RoleManus.Split('_').ToList(); int res = 0; var mql2 = RMS_RoleManusSet.RoleId.Equal(roleid); int f = RMBiz.Remove <RMS_RoleManusSet>(mql2); for (int i = 0; i < manu.Count; i++) { if (!string.IsNullOrEmpty(manu[i])) { RMS_RoleManus item = new RMS_RoleManus(); item.Id = Guid.NewGuid(); item.RoleId = roleid; item.ManuId = Guid.Parse(manu[i]); RMBiz.Add(item); res++; } } List <string> ManuButtons = RoleManuButtons.Split('_').ToList(); var mql = RMS_RoleManuButtonsSet.RoleId.Equal(roleid); int ff = RMBBiz.Remove <RMS_RoleManuButtonsSet>(mql); for (int i = 0; i < ManuButtons.Count; i++) { RMS_RoleManuButtons item = new RMS_RoleManuButtons(); item.Id = Guid.NewGuid(); string[] data = ManuButtons[i].Split(':'); if (!string.IsNullOrEmpty(data[0]) && !string.IsNullOrEmpty(data[1])) { item.RoleId = roleid; var sql = RMS_MenuButtonsSet.SelectAll().Where(RMS_MenuButtonsSet.ManuId.Equal(Guid.Parse(data[0])).And(RMS_MenuButtonsSet.ButtonId.Equal(Guid.Parse(data[1])))); RMS_MenuButtons bItem = MBBiz.GetEntity(sql); if (bItem != null) { item.MenuButtonsId = bItem.Id; } RMBBiz.Add(item); res++; } } if (res == manu.Count + ManuButtons.Count) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配权限, "角色管理--分配权限", true, WebClientIP, "角色管理"); return("ok"); } else { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配权限, "角色管理--分配权限", false, WebClientIP, "角色管理"); return("Nok"); } }
public JsonResult EditInfo(RMS_Role RMS_RoleModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; RMS_RoleModle.ModifyTime = DateTime.Now; if (!(RMS_RoleModle.Id != null && !RMS_RoleModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; RMS_RoleModle.CreateTime = DateTime.Now; RMS_RoleModle.Id = Guid.NewGuid(); } if (IsAdd) { RMS_RoleModle.ModifyBy = "1"; RMS_RoleModle.CreateBy = "1"; try { RDBiz.Add(RMS_RoleModle); ReSultMode.Code = 11; ReSultMode.Data = RMS_RoleModle.Id.ToString(); ReSultMode.Msg = "添加成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "角色管理--新增", true, WebClientIP, "角色管理"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "角色管理--新增", false, WebClientIP, "角色管理"); } } else { RMS_RoleModle.WhereExpression = RMS_RoleSet.Id.Equal(RMS_RoleModle.Id); RMS_RoleModle.ChangedMap.Remove("id");//移除主键值 if (RDBiz.Update(RMS_RoleModle) > 0) { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "修改成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "角色管理--修改", true, WebClientIP, "角色管理"); } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "角色管理--修改", false, WebClientIP, "角色管理"); } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
public JsonResult EditInfo(RMS_User EidModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { var mql2 = RMS_UserSet.LoginName.Equal(EidModle.LoginName); long i = OPBiz.GetCount <RMS_UserSet>(mql2); if (i > 0) { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "用户名已存在"; } else { EidModle.UserType = 0; EidModle.Id = Guid.NewGuid(); EidModle.CreateTime = DateTime.Now; EidModle.ModifyTime = DateTime.Now; //rol.RoleDescription = EidModle.RoleDescription; //rol.RoleOrder = EidModle.RoleOrder; OPBiz.Add(EidModle); ReSultMode.Code = 11; ReSultMode.Data = EidModle.Id.ToString(); ReSultMode.Msg = "添加成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "用户管理--新增", true, WebClientIP, "用户管理"); } } else { EidModle.WhereExpression = RMS_UserSet.Id.Equal(EidModle.Id); // spmodel.GroupId = GroupId; if (OPBiz.Update(EidModle) > 0) { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "修改成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "用户管理--修改", true, WebClientIP, "用户管理"); } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "用户管理--修改", false, WebClientIP, "用户管理"); } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
/// <summary> /// //删菜单按钮 /// </summary> /// <param name="btnId"></param> /// <param name="ManuId"></param> /// <returns></returns> public JsonResult DelManuBtn(string IdSet, string ManuId) { string[] ids = IdSet.Split(','); var mql2 = RMS_MenuButtonsSet.ButtonId.In(ids).And(RMS_MenuButtonsSet.ManuId.Equal(ManuId)); int f = MBDBiz.Remove <RMS_MenuButtonsSet>(mql2); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.除, "菜单管理--删除菜单按钮", true, WebClientIP, "菜单管理"); return(Json("OK", JsonRequestBehavior.AllowGet)); }
/// <summary> /// //删除 /// </summary> /// <param name="btnId"></param> /// <param name="ManuId"></param> /// <returns></returns> public JsonResult DelUnitsOut(string IdSet, string PersonnelFileId) { HttpReSultMode ReSultMode = new HttpReSultMode(); string[] ids = IdSet.Split(','); var mql2 = TF_PersonnelFile_Units_OutSet.UnitsId.In(ids).And(TF_PersonnelFile_Units_OutSet.PersonnelFileId.Equal(PersonnelFileId)); int f = outOPBiz.Remove <TF_PersonnelFile_Units_OutSet>(mql2); ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "成功删除" + f + "条数据!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.除, "人员档案库--删除转出单位", true, WebClientIP, "人员档案库"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
public JsonResult AddList(string listAll) { HttpReSultMode ReSultMode = new HttpReSultMode(); List <TF_PersonnelFile_Borrow> listItem = JsonHelper.JSONToList <TF_PersonnelFile_Borrow>(listAll); if (listItem != null && listItem.Count > 0) { for (int i = 0; i < listItem.Count; i++) { TF_PersonnelFile_Borrow EidModle = listItem[i]; EidModle.Id = Guid.NewGuid(); EidModle.CreateMan = UserData.UserName; EidModle.CreateManId = UserData.Id; EidModle.CreateTime = DateTime.Now; EidModle.isDeleted = false; EidModle.States = 0; EidModle.StatesName = "未操作"; OPBiz.Add(EidModle); } } try { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "成功添加" + listItem.Count + "条"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "档案借用--新增List", true, WebClientIP, "档案借用"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "档案借用--新增List", false, WebClientIP, "档案借用"); } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }
public JsonResult Del(string IDSet) { int f = OPBiz.DelForSetDelete("Id", IDSet); HttpReSultMode ReSultMode = new HttpReSultMode(); if (f > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.除, "证件登记--删除", true, WebClientIP, "证件登记"); ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "成功删除" + f + "条数据!"; return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } else { ReSultMode.Code = -13; ReSultMode.Data = "0"; ReSultMode.Msg = "删除失败!"; return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } }
public JsonResult Approve(string ID, string state = "0") {//ApprovalStates 状态(-1;--未提交;0--待审核;1--审核通过;2--审核不通过) string sql = string.Format("update TF_EntryAndExitRegistration set ApprovalStates={0},AprovalTime=getdate() Where Id='{1}'", state, ID); int f = OPBiz.ExecuteSqlWithNonQuery(sql); HttpReSultMode ReSultMode = new HttpReSultMode(); if (f > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.审核, "证件审核--审核", true, WebClientIP, "证件审核"); ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "审核处理成功!"; return Json(ReSultMode, JsonRequestBehavior.AllowGet); } else { ReSultMode.Code = -13; ReSultMode.Data = "0"; ReSultMode.Msg = "审核处理失败!"; return Json(ReSultMode, JsonRequestBehavior.AllowGet); } }
public JsonResult EditInfo(RMS_Menus Mode) { Random rnd = new Random(); bool IsAdd = false; if (!(Mode.Id != null && !Mode.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { Mode.Id = Guid.NewGuid(); Mode.CreateTime = DateTime.Now; Mode.ModifyTime = DateTime.Now; Mode.IsEnable = true; Mode.IsShow = true; MDBiz.Add(Mode); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "菜单管理--新增", true, WebClientIP, "菜单管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { Mode.WhereExpression = RMS_MenusSet.Id.Equal(Mode.Id); // spmodel.GroupId = GroupId; Mode.CreateTime = DateTime.Now; Mode.ModifyTime = DateTime.Now; if (MDBiz.Update(Mode) > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "菜单管理--修改", true, WebClientIP, "菜单管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "菜单管理--修改", false, WebClientIP, "菜单管理"); return(Json("Nok", JsonRequestBehavior.AllowGet)); } } }
public JsonResult SetRole(string UserId, string RoleId) { Guid uId = Guid.Parse(UserId); Guid rId = Guid.Parse(RoleId); var sql = RMS_UserRoleSet.SelectAll().Where(RMS_UserRoleSet.UserId.Equal(uId)); RMS_UserRole Rmodel = URBiz.GetEntity(sql); if (Rmodel == null) { Rmodel = new RMS_UserRole(); Rmodel.Id = Guid.NewGuid(); Rmodel.UserId = uId; Rmodel.RoleId = rId; URBiz.Add(Rmodel); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配角色, "用户管理--分配角色", true, WebClientIP, "用户管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { Rmodel.RoleId = rId; Rmodel.WhereExpression = RMS_UserRoleSet.Id.Equal(Rmodel.Id); // spmodel.GroupId = GroupId; if (URBiz.Update(Rmodel) > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配角色, "用户管理--分配角色", true, WebClientIP, "用户管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.分配角色, "用户管理--分配角色", false, WebClientIP, "用户管理"); return(Json("Nok", JsonRequestBehavior.AllowGet)); } } }
public JsonResult Approve(string ID, string state = "-1") {//States 状态(已审核--2、审核中--1,已提交--0,编辑中--1) string sql = string.Format("update TF_LifeComments set States={0} Where Id='{1}'", state, ID); int f = OPBiz.ExecuteSqlWithNonQuery(sql); HttpReSultMode ReSultMode = new HttpReSultMode(); if (f > 0) { ReSultMode.Code = 11; ReSultMode.Data = f.ToString(); ReSultMode.Msg = "提交审核成功!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.提交, "生平管理--用户提交", true, WebClientIP, "生平管理"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } else { ReSultMode.Code = -13; ReSultMode.Data = "0"; ReSultMode.Msg = "提交审核失败!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.提交, "生平管理--用户提交", false, WebClientIP, "生平管理"); return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); } }
public JsonResult EditInfo(RMS_Buttons RMS_ButtonsModle) { bool IsAdd = false; if (!(RMS_ButtonsModle.Id != null && !RMS_ButtonsModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { RMS_ButtonsModle.Id = Guid.NewGuid(); RMS_ButtonsModle.CreateTime = DateTime.Now; RMS_ButtonsModle.ModifyTime = DateTime.Now; //rol.RoleDescription = RMS_ButtonsModle.RoleDescription; //rol.RoleOrder = RMS_ButtonsModle.RoleOrder; OPBiz.Add(RMS_ButtonsModle); SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "按钮管理--新增", true, WebClientIP, "按钮管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { RMS_ButtonsModle.WhereExpression = RMS_ButtonsSet.Id.Equal(RMS_ButtonsModle.Id); // spmodel.GroupId = GroupId; if (OPBiz.Update(RMS_ButtonsModle) > 0) { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "按钮管理--修改", true, WebClientIP, "按钮管理"); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "按钮管理--修改", false, WebClientIP, "按钮管理"); return(Json("Nok", JsonRequestBehavior.AllowGet)); } } }
//[ValidateAntiForgeryToken] 安全必须 外网出错 所需的防伪 Cookie“__RequestVerificationToken”不存在。 暂时去掉,待解决 public ActionResult Index(LoginModel mode) { // if (ModelState.IsValid) ViewData["UserType"] = GenerateList(); //if (Session["ValidateCode"] != null) //{ #region 获取cookies //if (!string.IsNullOrEmpty(Request.Cookies["UserData"]["AdminUserInfo"]))//Cookies保存 获取解析 //{ // string dataj = Request.Cookies["UserData"]["AdminUserInfo"]; // UserData = JsonHelper.FromJson<AdminUserInfo>(dataj); // if (UserData != null) // { // return RedirectToAction("index", "home"); // } //} #endregion //string Vcode = Session["ValidateCode"].ToString(); //if (mode.VCode.Trim().Equals(Vcode))//验证码 //{ UserData = null; List <V_UserRole> adminRole = null; bool IsHaveP = false;//是否有权限登录 //20161024 janhuang if (mode.LoginName != "" && mode.Password != "") { mode.UserType = "1"; } else { mode.UserType = "2"; } #region 根据类型登录 switch (mode.UserType) { case "1": //账号密码登录 var sql = V_UserRoleSet.SelectAll().Where(V_UserRoleSet.LoginName.Equal(mode.LoginName).And(V_UserRoleSet.Password.Equal(mode.Password))); adminRole = URBiz.GetOwnList <V_UserRole>(sql); break; case "0": //姓名登录 var sql0 = V_UserRoleSet.SelectAll().Where(V_UserRoleSet.LoginName.Equal(mode.LoginName).And(V_UserRoleSet.UserType.Equal(0))); adminRole = URBiz.GetOwnList <V_UserRole>(sql0); if (adminRole != null && adminRole.Count > 0) //检查是否存在,不存在就添加,给登录用户的角色 { break; } else { RMS_User item = new RMS_User(); item.Id = Guid.NewGuid(); item.LoginName = mode.LoginName; item.UserType = 0; item.CreateTime = DateTime.Now; item.ModifyTime = DateTime.Now; uBiz.Add(item); List <RMS_Role> listRole = URBiz.GetOwnList <RMS_Role>(RMS_RoleSet.SelectAll().Where(RMS_RoleSet.RoleTypes.Equal(0))); //所有的姓名登录角色 RMS_UserRole urItem = new RMS_UserRole(); urItem.Id = Guid.NewGuid(); urItem.UserId = item.Id; urItem.RoleId = listRole[0].Id; urBiz.Add(urItem); adminRole = URBiz.GetOwnList <V_UserRole>(sql0); } break; case "2": //身份证登录 var sql2 = V_UserRoleSet.SelectAll().Where(V_UserRoleSet.LoginName.Equal(mode.LoginName).And(V_UserRoleSet.UserType.Equal(2))); adminRole = URBiz.GetOwnList <V_UserRole>(sql2); if (adminRole != null && adminRole.Count > 0) //检查是否存在,不存在就添加,给身份证用户的角色 { break; } else { RMS_User item = new RMS_User(); item.Id = Guid.NewGuid(); item.LoginName = mode.LoginName; item.UserType = 2; item.CreateTime = DateTime.Now; item.ModifyTime = DateTime.Now; uBiz.Add(item); List <RMS_Role> listRole = URBiz.GetOwnList <RMS_Role>(RMS_RoleSet.SelectAll().Where(RMS_RoleSet.RoleTypes.Equal(2))); //所有的姓名登录角色 RMS_UserRole urItem = new RMS_UserRole(); urItem.Id = Guid.NewGuid(); urItem.UserId = item.Id; urItem.RoleId = listRole[0].Id; urBiz.Add(urItem); adminRole = URBiz.GetOwnList <V_UserRole>(sql2); } break; default: break; } #endregion if ((adminRole != null && adminRole.Count > 0)) // 账号是否存在,添加权限配置 { #region 存用户数据 UserData = new AdminUserInfo(); var sql222 = V_UserRoleSet.SelectAll().Where(V_UserRoleSet.LoginName.Equal(mode.LoginName)); var newadminRole = URBiz.GetOwnList <V_UserRole>(sql222); UserData.UserTypes = int.Parse(newadminRole[0].UserType.ToString()); // UserData.adminUserInfo = adminRole[0]; UserData.Id = adminRole[0].Id; UserData.UserName = adminRole[0].LoginName; UserData.RoleId = adminRole[0].RoleId; UserData.Password = adminRole[0].Password; if (!string.IsNullOrEmpty(adminRole[0].Tel)) { UserData.Modify = true; } else { UserData.Modify = false; } if (adminRole[0].DepartmentId != null) { //var dpsql = RMS_DepartmentSet.SelectAll().Where(RMS_DepartmentSet.Id.Equal(adminRole[0].DepartmentId)); //RMS_Department dpItem = dpBiz.GetEntity(dpsql); //if (dpItem != null) //{ UserData.DepartmentId = (Guid)adminRole[0].DepartmentId; UserData.DepartmentName = adminRole[0].DepartmentName; //} } IsHaveP = true; #endregion #region 获取权限 if (IsHaveP) //可以登录 { List <V_RoleManus> manus = URBiz.GetOwnList <V_RoleManus>(V_RoleManusSet.SelectAll().Where(V_RoleManusSet.RoleId.Equal(UserData.RoleId))); //所有的菜单 List <V_RoleManuButtons> buttons = URBiz.GetOwnList <V_RoleManuButtons>(V_RoleManuButtonsSet.SelectAll().Where(V_RoleManuButtonsSet.RoleId.Equal(UserData.RoleId))); //角色拥有的菜单的所有按钮 List <V_MenuButtons> AllButtons = URBiz.GetOwnList <V_MenuButtons>(V_MenuButtonsSet.SelectAll()); //所有菜单的所有按钮 List <Manu> ListManus = new List <Manu>(); if (manus != null && manus.Count > 0) { foreach (V_RoleManus item in manus) { Manu OneManu = new Manu(); OneManu.manuInfo = item; OneManu.ListButtons = buttons.FindAll(p => p.ManuId.Equals(item.ManuId)).OrderBy(p => p.OrderNo).ToList(); OneManu.ManuAllButton = AllButtons.FindAll(p => p.ManuId.Equals(item.ManuId)); ListManus.Add(OneManu); } UserData.ListManus = ListManus; } #region 存cookies string datajson = JsonHelper.ToJson(UserData); HttpCookie cookie = new HttpCookie("UserData"); //初使化并设置Cookie的名称 DateTime dt = DateTime.Now; TimeSpan ts = new TimeSpan(0, 1, 0, 0, 0); //过期时间为1分钟 cookie.Expires = dt.Add(ts); //设置过期时间 cookie.Values.Add("AdminUserInfo", datajson); Response.AppendCookie(cookie); #endregion SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.登录, "登录", true, WebClientIP, "用户登录"); return(RedirectToAction("index", "home")); } #endregion } else { // return RedirectToAction("index", "Login"); // 如果我们进行到这一步时某个地方出错,则重新显示表单 ViewData["IsShowAlert"] = true; ViewData["Alert"] = "账号或者密码有误"; SysOperateLogBiz.AddSysOperateLog(mode.LoginName, mode.LoginName, e3net.Mode.OperatEnumName.登录, "登录失败", false, WebClientIP, "用户登录"); } //} //else //{ // ViewData["IsShowAlert"] = true; // ViewData["Alert"] = "验证码有误"; //} //} return(View()); }
public JsonResult ScatteredEditInfo(TF_PersonnelFile_Transmitting_Out EidModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { EidModle.Id = Guid.NewGuid(); EidModle.CreateMan = UserData.UserName; EidModle.CreateManId = UserData.Id; EidModle.CreateTime = DateTime.Now; EidModle.isDeleted = false; EidModle.States = 0; EidModle.SubmitState = "零散"; try { List <TF_PersonnelFile_Transmitting_Out_Item> listItem = JsonHelper.JSONToList <TF_PersonnelFile_Transmitting_Out_Item>(EidModle.FistName); int OriginalCount = 0; int DuplicateCount = 0; int MaterialCount = 0; string allname = ""; if (listItem != null && listItem.Count > 0) { EidModle.FistName = listItem[0].RealName; allname += listItem[0].RealName + "、"; for (int i = 0; i < listItem.Count; i++) { OriginalCount += listItem[i].OriginalCount; DuplicateCount += listItem[i].DuplicateCount; MaterialCount += listItem[i].MaterialCount;//统计数 listItem[i].Id = Guid.NewGuid();; listItem[i].OwnerId = EidModle.Id; OPItemBiz.Add(listItem[i]);//添加项 } EidModle.OriginalCount = OriginalCount; EidModle.DuplicateCount = DuplicateCount; EidModle.MaterialCount = MaterialCount; EidModle.NumberS = listItem.Count; } allname = allname.TrimEnd('、'); EidModle.FileName = allname; OPBiz.Add(EidModle); ReSultMode.Code = 11; ReSultMode.Data = EidModle.Id.ToString(); ReSultMode.Msg = "添加成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "档案转出--零散材料新增", true, WebClientIP, "档案转出"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "档案转出--零散材料新增", false, WebClientIP, "档案转出"); } } else { EidModle.WhereExpression = TF_PersonnelFile_Transmitting_OutSet.Id.Equal(EidModle.Id); List <TF_PersonnelFile_Transmitting_Out_Item> listItem = JsonHelper.JSONToList <TF_PersonnelFile_Transmitting_Out_Item>(EidModle.FistName); EidModle.FistName = listItem[0].RealName; EidModle.TransmittingMan = UserData.UserName; EidModle.TransmittingTime = DateTime.Now; // EidModle.ChangedMap.Remove("id");//移除主键值 if (OPBiz.Update(EidModle) > 0) { int OriginalCount = 0; int DuplicateCount = 0; int MaterialCount = 0; if (listItem != null && listItem.Count > 0) { EidModle.FistName = listItem[0].RealName; for (int i = 0; i < listItem.Count; i++) { // OriginalCount += listItem[i].OriginalCount; // DuplicateCount += listItem[i].DuplicateCount; // MaterialCount += listItem[i].MaterialCount;//统计数 // listItem[i].Id = listItem[i].Id; ; // listItem[i].OwnerId = EidModle.Id; listItem[i].WhereExpression = TF_PersonnelFile_Transmitting_Out_ItemSet.Id.Equal(listItem[i].Id); OPItemBiz.Update(listItem[i]);//添加项 } } ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "修改成功"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "档案转出--零散材料修改", true, WebClientIP, "档案转出"); } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "档案转出--零散材料修改", false, WebClientIP, "档案转出"); } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }