public async Task <int> Insert(Models.Registration registration) { _dbContext.Add(registration); await _dbContext.SaveChangesAsync(); return(registration.Id); }
public ActionResult Register(Models.Registration reg, HttpPostedFileBase Image) { if (Image != null) { // Save the image to our site string filename = Guid.NewGuid().ToString().Substring(0, 6) + Image.FileName; // Specify the path to save the file to string path = Path.Combine(Server.MapPath("~/content/"), filename); // Save the file Image.SaveAs(path); // Update registration object with the Image reg.Image = "/content/" + filename; } // Create our Membership user Membership.CreateUser(reg.Username, reg.Password); // Create our author object Models.Author author = new Models.Author(); author.Name = reg.Name; author.ImageUrl = reg.Image; author.Username = reg.Username; // Add author to db db.Authors.Add(author); db.SaveChanges(); // Log in the user FormsAuthentication.SetAuthCookie(reg.Username, false); return(RedirectToAction("Index", "Post")); }
public HttpResponseMessage PostUser([FromBody] Models.Registration user) { _repository.AddUser(user.Email, user.Name, user.Surname); return(Request.CreateResponse (System.Net.HttpStatusCode.Created, string.Format("User {0} was sucessfully added", user.Name))); }
public ActionResult LogIn(Models.Registration userr) { //if (ModelState.IsValid) //{ // InsureEntities db = new InsureEntities(); using (var db = new checkintegration.Models.InsureEntities()) { var user = db.Registrations.FirstOrDefault(u => u.UserName == userr.UserName && u.Password == userr.Password); if (user != null) { if (user.RoleId == 1) { return(RedirectToAction("Dashboard", "Admin")); } else if (user.RoleId == 2) { FormsAuthentication.SetAuthCookie(userr.UserName, false); Session["UserId"] = user.UserID; return(RedirectToAction("Homepage", "Home")); } else { Session["CustId"] = user.UserID; FormsAuthentication.SetAuthCookie(userr.UserName, false); return(RedirectToAction("Surveyor_Index", "Surveyor")); } } } return(View(userr)); }
public async Task <IActionResult> PutRegistration([FromRoute] int id, [FromBody] Models.Registration @registration) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != @registration.RegistrationId) { return(BadRequest()); } _context.Entry(@registration).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RegistrationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostRegistration([FromBody] Models.Registration @registration) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Registrations.Add(@registration); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (RegistrationExists(@registration.RegistrationId)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetRegistration", new { id = @registration.RegistrationId }, @registration)); }
public async Task <IActionResult> Index() { try { Models.Registration registrationDetails = new Models.Registration { appName = "TradeBank3", UniqueCode = "pspspspspppsp" }; var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/bank/register"); var client = _clientFactory.CreateClient("TradeBankProject"); var json = JsonConvert.SerializeObject(registrationDetails); request.Content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await client.SendAsync(request); if (response.IsSuccessStatusCode) { response.EnsureSuccessStatusCode(); } else { throw new HttpRequestException(); } } catch (Exception e) { } return(View()); }
public ActionResult Register(Models.Registration registration, HttpPostedFileBase ImageURL) { if (ImageURL != null) { //save the image to our website string filename = Guid.NewGuid().ToString().Substring(0, 6) + ImageURL.FileName; //specify the path to save the file to string path = Path.Combine(Server.MapPath("~/content/"), filename); //save the file ImageURL.SaveAs(path); //update our regisration object, with the Image registration.ImageURL = "/content/" + filename; } //create our Membership user Membership.CreateUser(registration.UserName, registration.Password); //create our author object Models.Author author = new Models.Author(); author.Name = registration.Name; author.ImageURL = registration.ImageURL; author.UserName = registration.UserName; //add the author to the database db.Authors.Add(author); db.SaveChanges(); //registration complete, log in the user FormsAuthentication.SetAuthCookie(registration.UserName, false); //kick the user to the create post section return(RedirectToAction("Index", "Post")); }
public ActionResult Register(Models.Registration register, HttpPostedFileBase Image) { if (Image != null) { //save the image to the website //Guid characters used to make sure the file name is not repeated so that the file is not overwritten string fileName = Guid.NewGuid().ToString().Substring(0, 6) + Image.FileName; //specify the path to save the file to string path = Path.Combine(Server.MapPath("~/content/"), fileName); //Save the file Image.SaveAs(path); //update our registration object with the image register.Image = "/content/" + fileName; } //create our Membership user Membership.CreateUser(register.UserName, register.Password); //create our Author object Models.Author author = new Models.Author(); author.Name = register.Name; author.ImageUrl = register.Image; author.UserName = register.UserName; //add the author to the database db.Authors.Add(author); db.SaveChanges(); //registration complete Log in the user FormsAuthentication.SetAuthCookie(register.UserName, false); return(RedirectToAction("Index", "Posts")); }
public async Task <int> Update(Models.Registration registration) { _dbContext.Entry(registration).State = EntityState.Modified; await _dbContext.SaveChangesAsync(); return(registration.Id); }
public ActionResult Register(Models.Registration registration, HttpPostedFileBase Image) { if (Image != null) { //save the image to our website //GUID generates random characters, that we // can use to make sure the file name is not // repeated string filename = Guid.NewGuid().ToString().Substring(0, 6) + Image.FileName; //specify the path to save the file to. // Server.MapPath actually gets the physical // location of the website on the server string path = Path.Combine(Server.MapPath("~/content/"), filename); // SAVE the file Image.SaveAs(path); //update our registration object, with the Image registration.Image = "/content/" + filename; } //create our Membership user Membership.CreateUser(registration.Username, registration.Password); //create and populate our Author object Models.Author author = new Models.Author(); author.Name = registration.Name; author.ImageUrl = registration.Image; author.UserName = registration.Username; //add the author to the database db.Authors.Add(author); db.SaveChanges(); //registration complete! Log in the user FormsAuthentication.SetAuthCookie(registration.Username, false); //kick the user to the create post section return(RedirectToAction("Index", "Post")); }
public RegistrationVM() { NewRegistration = new Models.Registration(); ICountryRepository repo = SimpleIoc.Default.GetInstance<ICountryRepository>(); Countries = new ObservableCollection<Country>(repo.GetCountries()); RaisePropertyChanged(() => Countries); SaveCommand = new RelayCommand(Save); }
// M e t h o d s // C r e a t e public Models.Registration AddRegistration(Models.Registration registration) { if (registration == null || registration.Id > 0 || registration.VehicleId <= 0 || _vehicleRepository.VehicleExists(registration.VehicleId) == false) { return(null); } _context.Registration.Add(registration); _context.SaveChanges(); return(registration); }
private Models.Registration _Map(Data.Registration source) { var model = new Models.Registration { ID = source.ID, User_ID = source.User_ID, Event_ID = source.Event_ID, Type = source.Type }; return(model); }
private Data.Registration _Map(Models.Registration registration) { var data = new Data.Registration { ID = registration.ID, User_ID = registration.User_ID, Event_ID = registration.Event_ID, Type = registration.Type }; return(data); }
public async Task <IActionResult> Post([FromBody] Models.Registration registration) { try { if (registration == null) { return(BadRequest()); } if (registration.Id == 0) { var appUser = new ApplicationUser { Email = registration.Email, UserName = registration.Email, PhoneNumber = registration.MobileNumber, SecurityStamp = Guid.NewGuid().ToString() }; var res = await _userManager.CreateAsync(appUser, registration.Password); var result = await _registrationRepository.Insert(registration); if (result != null) { return(Ok(result)); } else { return(BadRequest()); } } else { var result = await _registrationRepository.Update(registration); if (result != null) { return(Ok(result)); } else { return(BadRequest()); } } } catch (Exception ex) { return(BadRequest(ex)); } }
public ActionResult LogIn(Models.Registration userr) { if (IsValid(userr.Email, userr.Password)) { FormsAuthentication.SetAuthCookie(userr.Email, false); return(RedirectToAction("Index", "Customer")); } else { ModelState.AddModelError("", "Login details are wrong."); } return(View(userr)); }
public Models.Registration UpdateRegistrationPutEntire(Models.Registration registration, int id) { Models.Registration registrationToUpdate = GetRegistrationById(id); if (registrationToUpdate != null) { registrationToUpdate.Date = registration.Date; registrationToUpdate.State = registration.State; registrationToUpdate.TotalCost = registration.TotalCost; _context.SaveChanges(); } return(registrationToUpdate); }
public Models.Registration GetRegistrationById(int id) { if (_userRepository == null || _userRepository.IsUserLoggedIn() == false) { return(null); } Models.Registration registration = _context.Registration.FirstOrDefault(r => r.Id == id); if (registration == null || _vehicleRepository.VehicleExists(registration.VehicleId) == false) { return(null); } return(registration); }
public ActionResult Register(Models.Registration user) { try { if (ModelState.IsValid) { using (var db = new LoginInMVC4WithEF.Models.UserEntities2()) { var crypto = new SimpleCrypto.PBKDF2(); var encrypPass = crypto.Compute(user.Password); var newUser = db.Registrations.Create(); newUser.Email = user.Email; newUser.Password = encrypPass; newUser.PasswordSalt = crypto.Salt; newUser.FirstName = user.FirstName; newUser.LastName = user.LastName; newUser.UserType = "User"; newUser.CreatedDate = DateTime.Now; newUser.IsActive = true; newUser.IPAddress = "642 White Hague Avenue"; db.Registrations.Add(newUser); db.SaveChanges(); return(RedirectToAction("Index", "Home")); } } else { ModelState.AddModelError("", "Data is not correct"); } } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } return(View()); }
private Models.Registration CreateRegistration(ViewModels.Registration registration) { string classCode = registration.ClassCode; var courseClass = Context.CourseClass .Include(cc => cc.Course) .Where(cc => cc.CourseClassCode == classCode) .FirstOrDefault(); var convertedRegistration = new Models.Registration() { Status = true, SemesterId = registration.Semester, StudentId = registration.StudentId, CourseId = courseClass.Course.Id, CourseClassId = courseClass.CourseClassId }; return(convertedRegistration); }
public ActionResult LogIn(Models.Registration userr) { //if (ModelState.IsValid) //{ if (IsValid(userr.Email, userr.Password)) { FormsAuthentication.SetAuthCookie(userr.Email, false); return(RedirectToAction("Index", "Home")); } else { ModelState.AddModelError("", "Login details are wrong."); } //} //else //{ // ModelState.AddModelError("", "Error, Check data"); //} return(View(userr)); }
// D e l e t e public bool DeleteRegistration(int id) { Models.Registration registrationToDelete = GetRegistrationById(id); if (registrationToDelete == null) { return(false); } try { _context.Registration.Remove(registrationToDelete); _context.SaveChanges(); return(true); } catch (Exception) { } return(false); } // end DeleteRegistration( )
/// <summary> /// 參加表報名成功 /// </summary> /// <returns></returns> public ActionResult RegistrationSuccessed(String userName) { PubClass myClass = new PubClass(); DataTable dtData = myClass.GetRegistrationData(userName); if (dtData.Rows.Count < 1) { return(RedirectToAction("Registration")); //回到報名表 } DataRow drRow = dtData.Rows[0]; Models.Registration registrationData = new Models.Registration(); registrationData.userName = drRow["userName"].ToString(); registrationData.phoneNumber = drRow["phoneNumber"].ToString(); registrationData.job = drRow["job"].ToString(); registrationData.jobIntroduction = drRow["jobIntroduction"].ToString(); registrationData.img = (byte[])drRow["img"]; return(View(registrationData)); }
public async Task <long> CreateRegistration(long mindfightId, long teamId) { var currentMindfight = await _mindfightRepository .FirstOrDefaultAsync(x => x.Id == mindfightId); if (currentMindfight == null) { throw new UserFriendlyException("Protmūšis su nurodyti id neegzistuoja!"); } var currentTeam = await _teamRepository .GetAll() .FirstOrDefaultAsync(x => x.Id == teamId); if (currentTeam == null) { throw new UserFriendlyException("Komanda su nurodytu id neegzistuoja!"); } if (_userManager.AbpSession.UserId != currentTeam.LeaderId) { throw new UserFriendlyException("Jūs nesate komandos kapitonas!"); } var currentRegistration = await _registrationRepository .FirstOrDefaultAsync(x => x.MindfightId == mindfightId && x.TeamId == teamId); if (currentRegistration != null) { throw new UserFriendlyException("Registracija jau egzistuoja!"); } currentRegistration = new Models.Registration(currentMindfight, currentTeam) { CreationTime = Clock.Now }; return(await _registrationRepository.InsertOrUpdateAndGetIdAsync(currentRegistration)); }
// U p d a t e public Models.Registration UpdateRegistrationPatchPartial(Models.Registration registration, int id) { Models.Registration registrationToUpdate = GetRegistrationById(id); if (registrationToUpdate != null) { if (registration.Date != null) { registrationToUpdate.Date = registration.Date; } if (registration.State != null) { registrationToUpdate.State = registration.State; } if (registration.TotalCost > 0) { registrationToUpdate.TotalCost = registration.TotalCost; } _context.SaveChanges(); } return(registrationToUpdate); }
/// <summary> /// 報名表處理 /// </summary> /// <param name="registrationData"></param> /// <param name="userImg"></param> /// <returns></returns> public ActionResult RegistrationProcessing(Models.Registration registrationData, HttpPostedFileBase userImg) { PubClass myClass = new PubClass(); byte[] pic = null; if (userImg != null) { pic = new byte[userImg.ContentLength]; userImg.InputStream.Read(pic, 0, userImg.ContentLength); MemoryStream ms2 = new MemoryStream(pic); Image originalImage = Image.FromStream(ms2); if (originalImage.PropertyIdList.Contains(0x0112)) { int rotationValue = originalImage.GetPropertyItem(0x0112).Value[0]; switch (rotationValue) { case 1: // landscape, do nothing break; case 8: // rotated 90 right // de-rotate: originalImage.RotateFlip(rotateFlipType: RotateFlipType.Rotate270FlipNone); break; case 3: // bottoms up originalImage.RotateFlip(rotateFlipType: RotateFlipType.Rotate180FlipNone); break; case 6: // rotated 90 left originalImage.RotateFlip(rotateFlipType: RotateFlipType.Rotate90FlipNone); break; } } Image ii = originalImage; Bitmap bp = new Bitmap(ii, 300, 300); System.IO.MemoryStream ms = new System.IO.MemoryStream(); bp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); pic = ms.GetBuffer(); ms.Close(); } bool blnIsSuccessed = myClass.InsertData( registrationData.userName , registrationData.phoneNumber , registrationData.job , registrationData.jobIntroduction , pic ); if (blnIsSuccessed) { return(RedirectToAction("RegistrationSuccessed", new { userName = registrationData.userName })); } else { return(RedirectToAction("RegistrationFaild")); } }
public ActionResult Register(Models.Registration user, FormCollection fc) { try { if (ModelState.IsValid) { user.RoleId = 2; using (InsureEntities db = new InsureEntities()) { /* var newUser = db.Registrations.Create(); * // newUser.UserID = user.UserID; * newUser.FirstName = user.FirstName; * newUser.LastName = user.LastName; * newUser.UserName = user.UserName; * newUser.EmailId = user.EmailId; * newUser.Password = user.Password; * newUser.ConfirmPassword = user.ConfirmPassword; * newUser.Gender = user.Gender; * // newUser.RoleId = user.RoleId; * newUser.Address = user.Address; * newUser.Pincode = user.Pincode; * newUser.PhoneNumber = user.PhoneNumber; */ var username = db.Registrations.Where(u => u.UserName == user.UserName).FirstOrDefault(); var em = db.Registrations.Where(u => u.EmailId == user.EmailId).FirstOrDefault(); if (username != null) { ViewBag.Error = "UserName already Exist"; return(View("Register", user)); } else if (em != null) { ViewBag.Error = "EmailId already Exist"; return(View("Register", user)); } else { //user.FirstName user.Gender = fc["type"].ToString(); db.Registrations.Add(user); db.SaveChanges(); ModelState.Clear(); Session["UserID"] = user.UserID; ViewBag.Error = "Sucessfully Submitted"; user = null; return(RedirectToAction("Index", "Home")); } } } else { ModelState.AddModelError("", "Data is not correct"); } } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } return(View()); }
// string OldPassword, string NewPassword, string NewConfirmPassword,string UserID public ActionResult Change_Password(Models.Registration user) { InsureEntities db = new InsureEntities(); //LoginMst obj = new LoginMst(); var lst = db.Registrations.Where(P => P.EmailId == user.EmailId && P.Password == user.Password).SingleOrDefault(); var ls = db.Registrations.Where(P => P.Password == user.NewPassword).SingleOrDefault(); //bool IsUserExist = db.LoginMsts.Where(P => P.SrNo == UserID && P.Password==OldPassword).Any(); if (lst != null) { ViewBag.message = "Changing done"; if (ls != null) { ViewBag.Error = "New Password already Exist"; return(RedirectToAction("Change_Password", "Home")); } else { var ab = db.Registrations.Where(P => P.EmailId == user.EmailId && P.Password == user.Password).SingleOrDefault(); // var cd = db.Registrations.Where(P => P.Password == user.NewPassword).SingleOrDefault(); Registration rg = new Registration(); rg.UserID = ab.UserID; rg.FirstName = ab.FirstName; rg.LastName = ab.LastName; rg.UserName = ab.UserName; rg.EmailId = ab.EmailId; rg.Password = user.NewPassword; rg.ConfirmPassword = user.NewConfirmPassword; rg.Gender = ab.Gender; rg.RoleId = ab.RoleId; rg.Address = ab.Address; rg.Pincode = ab.Pincode; rg.PhoneNumber = ab.PhoneNumber; db.Entry(ab).State = EntityState.Detached; db.Entry(rg).State = EntityState.Modified; /* lst.Password = user.NewPassword; * lst.ConfirmPassword = user.NewConfirmPassword;*/ ViewBag.message = "Changing password successflly done"; // db.Registrations.Add(user); try { db.SaveChanges(); } catch (DbEntityValidationException ex) { foreach (var entityValidationErrors in ex.EntityValidationErrors) { foreach (var validationError in entityValidationErrors.ValidationErrors) { Response.Write("Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage); } } } /* System.Diagnostics.Debug.Write("Hello via Debug!"+lst.Password); * return RedirectToAction("Change_Password", "Home");*/ return(Json(ViewBag.message)); } //return 0; } else { ViewBag.Error = "Email Id or Password is wrong!!"; return(RedirectToAction("Change_Password", "Home"));; } /*catch (DbEntityValidationException ex) * { * foreach (var entityValidationErrors in ex.EntityValidationErrors) * { * foreach (var validationError in entityValidationErrors.ValidationErrors) * { * Response.Write("Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage); * } * } * }*/ return(View()); }
// GET: Registration public ActionResult Registration(String name, String email, String phone, String password, String password_confirm) { string sua = Request.UserAgent.Trim().ToLower(); var request = HttpContext.Request; if (request.Browser.IsMobileDevice) { sua += "*Mobile"; } else { sua += "*Laptop/Desktop"; //laptop or desktop } if (sua.Contains("iphone") || sua.Contains("ipad") || sua.Contains("android")) { Session["D"] = "Mobile"; } else { String[] x = sua.Split('*'); if (x[1].Equals("Mobile")) { Session["D"] = "Mobile"; } else { Session["D"] = "Desktop"; } } Models.Registration rg = new Models.Registration(); try { rg.name = name; rg.password = password; rg.email = email; rg.password_confrim = password_confirm; if (!(rg.password.Equals(rg.password_confrim))) { rg.msg = "Password Doesnt Match"; } else { Models.Database db = new Models.Database(); db.DatabaseCon("EAlo"); db.setData("Insert into users(Name,Email,Password,Phone) values(" + "'" + rg.name + "'," + "'" + rg.email + "'," + "'" + rg.password + "'," + "'" + phone + "'" + ")"); ///Database } return(View(rg)); } catch (Exception e) { return(View(rg)); } }
public ActionResult AddServeyor(Models.Registration user) { try { if (ModelState.IsValid) { user.RoleId = 3; Status_surveyor ss = new Status_surveyor(); using (InsureEntities db = new InsureEntities()) { if (user.UserID == 0) { var username = db.Registrations.Where(u => u.UserName == user.UserName).FirstOrDefault(); var em = db.Registrations.Where(u => u.EmailId == user.EmailId).FirstOrDefault(); if (username != null) { ViewBag.Error = "UserName already Exist"; return(View("AddServeyor", user)); } else if (em != null) { ViewBag.Error = "EmailId already Exist"; return(View("AddServeyor", user)); } else { db.Registrations.Add(user); db.SaveChanges(); ss.SurvId = user.UserID; ss.Status = 1; db.Status_surveyor.Add(ss); db.SaveChanges(); ModelState.Clear(); ViewBag.Error = "Sucessfully Submitted"; user = null; return(RedirectToAction("Dashboard", "Admin")); } } else { var username = db.Registrations.Where(u => u.UserName == user.UserName && u.UserID != user.UserID).FirstOrDefault(); var em = db.Registrations.Where(u => u.EmailId == user.EmailId && u.UserID != user.UserID).FirstOrDefault(); if (username != null) { ViewBag.Error = "UserName already Exist"; return(View("AddServeyor", user)); } else if (em != null) { ViewBag.Error = "EmailId already Exist"; return(View("AddServeyor", user)); } else { db.Entry(user).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); ViewBag.Error = "Sucessfully Submitted"; user = null; return(RedirectToAction("Dashboard", "Admin")); } } } } else { ModelState.AddModelError("", "Data is not correct"); } } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } return(View()); }
public ActionResult Register() { if (Session["logged_in_user_obj"] != null) return RedirectToAction("Index", "Dashboard"); //Languages var uClient = new SMARestClient("UserService.svc"); var languageContent = uClient.Get<List<Language>>("languages/"); var languages = languageContent.ToList().Select(c => new SelectListItem { Text = c.Name, Value = c.Name.ToString(), }).ToList(); ViewBag.LanguageList = languages; var cClient = new SMARestClient("CountryService.svc"); var countryContent = cClient.Get<List<Country>>("countries/"); var countries = countryContent.ToList().Select(c => new SelectListItem { Text = c.Name, Value = c.Name.ToString() }).ToList(); ViewBag.CountryList = countries; //Interest var interestContent = uClient.Get<List<InterestPopularity>>("interests/popular"); var interests = interestContent.ToList().Select(i => new SelectListItem { Text = i.Interest.Name, Value = i.Interest.Name.ToString(), }).ToList(); var vm = new Models.Registration(); foreach (var item in interestContent) { vm.Interests.Add(new Models.InterestModel { Interest = item.Interest, Popularity = item.Popularity }); } var session = System.Web.HttpContext.Current.Session; return View(vm); }