public IActionResult Info(string Emaile) { var User = _contex.informationUsers.ToList(); if (!ModelState.IsValid) { return(View()); } var Info = _contex.showInfos.FirstOrDefault(o => o.Email == Emaile); var Information = new InformationUser() { UserName = Info.UserName, FirstName = Info.FirstName, LastName = Info.LastName, City = Info.City, Adress = Info.Adress, Address2 = Info.Address2, Country = "Iran", PhoneNumber = Info.PhoneNumber, Email = Info.Email, NumberCodepos = Info.NumberCodepos, }; _contex.informationUsers.Add(Information); _contex.SaveChanges(); return(View()); }
public async Task <ActionResult> GetUserInformation() { ApplicationUser curUser = await _userManager.GetUserAsync(HttpContext.User); InformationUser infoUser = new InformationUser { Id = curUser.Id, UserName = curUser.UserName, FirstName = curUser.FirstName, LastName = curUser.LastName, Address = curUser.Address, Role = curUser.Role, PhoneNumber = curUser.PhoneNumber, Email = curUser.Email, //ListAreaWorking = GetListAreaWorkingInfo(curUser), DateOfBirth = curUser.DateOfBirth.ToDate(), Gender = curUser.Gender, IsEnabled = curUser.IsEnabled, Avatar = curUser.Avatar, CompanyId = curUser.CompanyId, Note = curUser.Note }; return(Ok(infoUser)); }
// GET: /Account/Manage public ActionResult Manage() { InformationUser modelInformationUser = new InformationUser(); var loginName = this.HttpContext.User.Identity.Name; var userGlobalData = _userService.GetGlobalDataByUserName(loginName); //var itemPerm = _permissionService.ModulesPermited(userGlobalData); //var dashboardsPermited = _permissionService.DashBoardsPermited(userGlobalData); //modelInformationUser.DashBoardsPermited = dashboardsPermited; modelInformationUser.GlobalData = userGlobalData; //modelInformationUser.ModulesPermited = itemPerm; modelInformationUser.OperationsPermited = new List <OperationPermited>(); foreach (Operations operation in Enum.GetValues(typeof(Operations))) { OperationPermited operationPermited = new OperationPermited(); operationPermited.Operation = operation; //operationPermited.Permited = _permissionService.isOperationPermited(6400, operation, userGlobalData); modelInformationUser.OperationsPermited.Add(operationPermited); } ViewBag.ReturnUrl = Url.Action("Manage"); return(View(modelInformationUser)); }