public JsonResult UpdateMyProfile(myProfile model) { var userId = userManager.GetUserId(User); Profile user = _userservices.GetCurrentUser(userId); model.ProfileId = user.ProfileId; ResponseModel response = new ResponseModel(); response.message = "er|My Profile NO Actualizado| Users"; response = _userservices.UpdateMyProfile(model); user = _userservices.GetCurrentUser(userId); myProfile myprof = new myProfile(); myprof.ProfileId = user.ProfileId; myprof.LoginId = user.LoginId; myprof.Nombre = user.Nombre; myprof.Phone = user.Phone; myprof.Extension = user.Extension; myprof.UserName = user.UserName; myprof.Email = user.Email; myprof.PhoneProviderId = user.PhoneProviderId; myprof.twitter = user.twitter; myprof.facebook = user.facebook; myprof.instagram = user.instagram; myprof.linkedIn = user.linkedIn; return(Json(myprof)); }
public async Task <ActionResult> Edit(myProfile myProfile) { if (ModelState.IsValid) { await MobileService.GetTable <myProfile>().UpdateAsync(myProfile); return(RedirectToAction("Index")); } return(View(myProfile)); }
public async Task <ActionResult> Create(myProfile myProfile) { if (ModelState.IsValid) { //db.myProfiles.Add(myProfile); //db.SaveChanges(); var table = MobileService.GetTable <myProfile>(); await table.InsertAsync(myProfile); return(RedirectToAction("Index")); } return(View(myProfile)); }
public JsonResult GetMyProfile() { var userId = userManager.GetUserId(User); Profile user = _userservices.GetCurrentUser(userId); myProfile myprof = new myProfile(); myprof.ProfileId = user.ProfileId; myprof.LoginId = user.LoginId; myprof.Nombre = user.Nombre; myprof.Phone = user.Phone; myprof.Extension = user.Extension; myprof.UserName = user.UserName; myprof.Email = user.Email; myprof.PhoneProviderId = user.PhoneProviderId; myprof.twitter = user.twitter; myprof.facebook = user.facebook; myprof.instagram = user.instagram; myprof.linkedIn = user.linkedIn; return(Json(myprof)); }