public string AddSprdUserToLHD(string hidNewUserSPRDID, string hidUserRole, string chkManager, string txtEnglishName, string txtChineseName, string txtAccount, string chkActive) { UserRoles roles; ResponseTypes tip; TipTypes information; User userByThirdPartyAccountID = UserService.GetUserByThirdPartyAccountID("SPRDUser", @"Spreadtrum\" + txtAccount); if (userByThirdPartyAccountID == null) { string userID = BaseController.CurrentUserInfo.UserID; if (!string.IsNullOrWhiteSpace(chkManager)) { hidUserRole = hidUserRole + "Admin"; } roles = (UserRoles)Enum.Parse(typeof(UserRoles), hidUserRole); bool active = !string.IsNullOrWhiteSpace(chkActive); SPRDUser sPRDUserByID = SPRDInterface.GetSPRDUserByID(hidNewUserSPRDID); UserService.CreateSPRDUser(roles, sPRDUserByID.Account, "SPRD", sPRDUserByID.EnglishName, sPRDUserByID.Email, active, userID); tip = ResponseTypes.Tip; information = TipTypes.Information; base.Response.Write(new HandlerResponse("0", "createLHDUserSuccessed", tip.ToString(), information.ToString(), "", "", "").GenerateJsonResponse()); return(null); } roles = (UserRoles)Enum.Parse(typeof(UserRoles), hidUserRole); if (!string.IsNullOrWhiteSpace(chkManager)) { hidUserRole = hidUserRole + "Admin"; } roles = (UserRoles)Enum.Parse(typeof(UserRoles), hidUserRole); UserService.ReActiveUser(userByThirdPartyAccountID.UserID, roles); tip = ResponseTypes.Tip; information = TipTypes.Information; base.Response.Write(new HandlerResponse("1", "reactiveLHDUserSuccessed", tip.ToString(), information.ToString(), "", "", "").GenerateJsonResponse()); return(null); }
public static User GetSPRDUserSN(string SN) { SPRDUser user = sprdUserGateway.GetSPRDUserBySN(SN); if (user != null) { User u = userGateway.GetUserByEmail(user.Email); if (u != null) { u.ChineseName = user.ChineseName; return(u); } } return(null); }
public void AddNew(SPRDUser newSPRDUser) { this.dbGateway.AddNew(newSPRDUser); }