public JsonResult Edit(OrganModel model) { try { if (model.Id == 1 || ViewDatas.GetInstance().GetUser(Request).RoleId != UserType.SysAdmin) { return(Json(new { State = false, Message = "您无权限编辑该组织!" })); } else { _business.Update(model); return(Json(new JsonResultLogModel { State = true, Message = "组织信息修改成功!", Log = $" 用户 {SiteUser.Username} 编辑组织 {model.Name} ", LogType = LogType.OrganManage, Username = SiteUser.Username })); } } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
//[AuthorizationFilter(Role = UserType.SysAdmin)] public JsonResult Del(int[] ids, int?Id) { try { if (Id.HasValue) { _business.Del((int)Id); } else { _business.Del(ids); } return(Json(new JsonResultLogModel { State = true, Message = "删除用户成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 删除人员 Id:{(Id.HasValue?Id.ToString():string.Join(",", ids))} 成功 ", LogType = LogType.TelbookManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
private void SearchButton2Execute() { ViewDatas.Clear(); ViewData v = new ViewData(); v.Field1 = "id"; v.Field2 = "body22222222222222222"; v.Field3 = "poet2"; ViewDatas.Add(v); ViewDatas.Add(v); Field1Text = "akira"; }
public JsonResult SolveAlarm(string alarmId) { try { _business.SolveAlarm(alarmId); LogBusiness.GetInstance().Add(new LogModel() { Content = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 成功处理告警 Id:{alarmId}", Time = DateTime.Now, Type = LogType.AlarmManage, Username = ViewDatas.GetInstance().GetUser(Request).Username }); return(Json(new { State = true, Message = "告警处理成功!" })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
public ActionResult Index() { ViewDatas model = new ViewDatas { Info = db.Infos.FirstOrDefault(), About = db.Abouts.FirstOrDefault(), Services = db.Services.ToList(), Facts = db.Facts.ToList(), Educations = db.Educations.ToList(), Experiences = db.Experiences.ToList(), Skills = db.Skills.ToList(), Categories = db.Categories.ToList(), Projects = db.Projects.ToList(), Photos = db.Photos.ToList(), TechnologyProjects = db.TechnologyProjects.ToList() }; return(View(model)); }
public JsonResult Del(int id) { try { _business.Del(id); return(Json(new JsonResultLogModel { State = true, Message = "删除组织成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 删除组织 id:{id} ", LogType = LogType.OrganManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
public IActionResult Add(TelbookModel model) { try { _business.Insert(model); return(Json(new JsonResultLogModel { State = true, Message = "用户添加成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 添加人员 {model.Name} 成功 ", LogType = LogType.TelbookManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
public JsonResult PingConfigEdit(string interval, string pingtimes, string pingsize, string pingttl) { try { _business.PingConfigEdit(interval, pingtimes, pingsize, pingttl); return(Json(new JsonResultLogModel { State = true, Message = "修改成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 修改Ping配置: 轮询间隔 为 “{interval}”小时;Ping次数 为“{pingtimes}”次;Ping包的大小 为 “{pingsize}”字节;Ping包的转发次数 为“{pingttl}”", LogType = LogType.ConfigManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
public JsonResult SysConfigEdit(string sysName, string rootName, string defaultPassword) { try { _business.SysConfigEdit(sysName, rootName, defaultPassword); return(Json(new JsonResultLogModel { State = true, Message = "修改成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 修改系统配置: 系统名称 为 “{sysName}”;分行名称 为“{rootName}”;默认重置密码 为 “{defaultPassword}”", LogType = LogType.ConfigManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
public JsonResult Add(OrganModel model) { try { //model.SMSTelephone= model.SMSTelephone.Substring(0, model.SMSTelephone.Length-1); _business.Insert(model); return(Json(new JsonResultLogModel { State = true, Message = "组织添加成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 添加组织 {model.Name} ", LogType = LogType.OrganManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }
//[AuthorizationFilter(Role = UserType.SysAdmin)] public JsonResult Edit(TelbookModel model) { try { //model.Content.Replace("\r\n", ""); _business.Update(model); return(Json(new JsonResultLogModel { State = true, Message = "用户信息修改成功!", Log = $" 用户 {ViewDatas.GetInstance().GetUser(Request).Username} 编辑人员 {model.Name} 成功 ", LogType = LogType.TelbookManage, Username = ViewDatas.GetInstance().GetUser(Request).Username })); } catch (Exception ex) { return(Json(new { State = false, Message = ex.Message })); } }