public Result Delete(Model.DB.User model) { UserRA.Delete(model.id.ToString()); MessageBiz.Send(model.id.ToString(), MessageTypeEnum.User_Forbidden); model.created_by = user_id; return(Result(UserDA.Delete(model))); }
public ResultLogin Login(Model.DB.User model) { ApiResultEnum result = UserDA.Login(ref model, platform); if (result == ApiResultEnum.Success) { string user_token = UserRA.Get(model.id.ToString(), "platform_" + platform); if (string.IsNullOrWhiteSpace(user_token)) { user_token = FuncHelper.GetUniqueString(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("platform_" + platform, user_token); dic.Add("name", model.name); dic.Add("status_order", model.status_order.ToString()); dic.Add("role", model.role.ToString()); dic.Add("login_time_" + platform, DateTime.Now.Format()); UserRA.Set(model.id.ToString(), dic); UserRA.SetExpire(model.id.ToString()); } return(new ResultLogin(result, model, model.id + "-" + user_token)); } else { return(new ResultLogin(result, null, null)); } }
public Result <int> Add(Model.DB.User model) { int id = 0; model.created_by = user_id; ApiResultEnum result = UserDA.Add(model, ref id); return(Result(result, id)); }
public Result Authority(Model.DB.User model) { MessageBiz.Send(model.id.ToString(), MessageTypeEnum.Authorization_Changed); return(Result(UserDA.Authority(model))); }
public Result Update(Model.DB.User model) { return(Result(UserDA.Update(model))); }