public Tuple <bool, string> Edit(V_PubUser_Dept model) { Pub_User user = model.MapTo <V_PubUser_Dept, Pub_User>(); var r = Update(user); if (!r) { return(Tuple.Create(false, "保存用户失败!")); } SaveUserRole(user.UserCode, model.RoleCodes); return(Tuple.Create(true, "保存成功")); }
public Tuple <bool, string> Add(V_PubUser_Dept model) { Pub_User user = model.MapTo <V_PubUser_Dept, Pub_User>(); user.UserCode = GetCode(); var r = Insert(user); if (r <= 0) { return(Tuple.Create(false, "保存用户失败!")); } SaveUserRole(user.UserCode, model.RoleCodes); return(Tuple.Create(true, "保存成功")); }
public DataRes <bool> Edit([FromBody] V_PubUser_Dept model) { DataRes <bool> res = new DataRes <bool>() { code = ResCode.Success, data = true }; model.Lmdt = DateTime.Now; var user = new LQExtensionUser(User); model.Lmid = $"{user.UserCode}-{user.UserName}"; var r = bll.Edit(model); if (!r.Item1) { res.code = ResCode.Error; res.data = false; res.msg = r.Item2; } return(res); }
public DataRes <bool> Add([FromBody] V_PubUser_Dept model) { DataRes <bool> res = new DataRes <bool>() { code = ResCode.Success, data = true }; model.Crdt = model.Lmdt = DateTime.Now; var user = User.GetZXYLUser(); model.Crid = model.Lmid = string.Format("{0}-{1}", user.UserCode, user.UserName); var r = bll.Add(model); if (!r.Item1) { res.code = ResCode.Error; res.data = false; res.msg = r.Item2; } return(res); }