/// <summary> /// 警员归队 /// </summary> /// <param name="id"></param> /// <returns></returns> public int UptState(int id) { var db = SimpleClientBase.GetSimpleClient <Alarm>(); var result = db.Update(m => new Alarm { State = 2 }, q => q.ID == id)?1:0; return(result); }
/// <summary> /// 警员状态修改 /// </summary> /// <param name="userid"></param> /// <returns></returns> public int UptUserState(int userid) { var db = SimpleClientBase.GetSimpleClient <Users>(); var result = db.Update(n => new Users { State = 1 }, w => w.ID == userid) ? 1 : 0; return(result); }
/// <summary> /// 操作报警信息 /// </summary> /// <param name="alarm"></param> /// <returns></returns> public int UptAlarm(int id, Alarm alarm) { var db = SimpleClientBase.GetSimpleClient <Alarm>(); var result = db.Update(m => new Alarm { OutID = alarm.OutID, SolvePeopleId = alarm.SolvePeopleId, OverTime = alarm.OverTime, State = 1 }, q => q.ID == id) ? 1 : 0; return(result); }
/// <summary> /// 修改用户保存 /// </summary> /// <param name="id"></param> /// <param name="users"></param>8x /// <param name="roleid"></param> /// <returns></returns> public int UpdateUser(Users users, string roleid, int id) { var db = SugerBase.GetInstance(); var client = SimpleClientBase.GetSimpleClient <Users>(); var result = db.Updateable(users).Where(m => m.ID == users.ID).ExecuteCommand(); //update关联表 if (result > 0) { var linkClient = SimpleClientBase.GetSimpleClient <UserRole>(); var res = linkClient.Update(m => new UserRole { RoleId = Convert.ToInt32(roleid) }, m => m.UserId == users.ID); return(res?1:0); } return(0); }
/// <summary> /// 修改角色保存 /// </summary> /// <param name="role"></param> /// <returns></returns> public int UpdateRole(Authority authority, string qxid, int id) { var db = SugerBase.GetInstance(); var client = SimpleClientBase.GetSimpleClient <Role>(); var result = db.Updateable(authority).Where(m => m.ID == authority.ID).ExecuteCommand(); //update关联表 if (result > 0) { var linkClient = SimpleClientBase.GetSimpleClient <RoleAuthority>(); var res = linkClient.Update(m => new RoleAuthority { RoleId = Convert.ToInt32(qxid) }, m => m.RoleId == authority.ID); return(res ? 1 : 0); } return(0); }