public JsonResult UpdateUserData(UserDataDetails userData) { UserDataDTO Model = new UserDataDTO(); var Data = objUserData.AddUserDetailsData(Model, 2, userData); return(new JsonResult { Data = Data, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public List <dynamic> AddUserDetailsData(UserDataDTO userDataDTO, int Type, UserDataDetails userDataDetails) { List <dynamic> objDynamic = new List <dynamic>(); switch (Type) { case 1: { Int64 n; bool isNumeric = Int64.TryParse(userDataDTO.strUserId, out n); if (isNumeric) { userDataDTO.UserId = n; AddUserData(userDataDTO); objDynamic.Add(userDataDTO.Status); objDynamic.Add(userDataDTO.UserId); objDynamic.Add(securityHelper.Encrypt(userDataDTO.UserId.ToString(), false)); break; } else if (!string.IsNullOrEmpty(userDataDTO.strUserId)) { userDataDTO.UserId = Convert.ToInt64(securityHelper.Decrypt(userDataDTO.strUserId, false)); } AddUserData(userDataDTO); objDynamic.Add(userDataDTO.Status); objDynamic.Add(userDataDTO.UserId); objDynamic.Add(securityHelper.Encrypt(userDataDTO.UserId.ToString(), false)); break; } case 2: { UserDataDTO DataDTO = new UserDataDTO(); var Data = JsonConvert.DeserializeObject <List <UserDataDTO> >(userDataDetails.strUserData); for (int i = 0; i < Data.Count; i++) { DataDTO = Data[i]; DataDTO.Type = 4; AddUserData(DataDTO); } objDynamic.Add(DataDTO.Status); break; } } return(objDynamic); }
public UserDataDetails GetUserDetails(string userId) { var user = _adminRepository.GetUserDetails(userId); var rolesForUser = new List <Role>(); var userVM = new UserDataDetails() { UserId = user.Id, Email = user.Email, EmailConfirmed = user.EmailConfirmed, UserName = user.UserName, }; return(userVM); }
public bool SavetoDatabase(RegDetails user) { UserDataDetails data2 = new UserDataDetails(); return(data2.SaveData(user)); }