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 UpdateStatusOrder(StatusOrder model) { string status_order = ((int)model.status).ToString(); if (UserRA.Exists(model.id.ToString())) { UserRA.Set(model.id.ToString(), "status_order", status_order); } MessageBiz.Send(model.id.ToString(), MessageTypeEnum.User_Order_Status, status_order); return(Result(UserDA.UpdateStatusOrder(model))); }