Ejemplo n.º 1
0
 public ActionResult AddAbout(AboutSelf AboutSelf, FormCollection form)
 {
     AboutSelf.Sex = form["gender"];
     AboutSelf.Hobbies = form["hobbies"];
     AboutSelf.UserId = Convert.ToInt32(form["UserId"]);
     if (ModelState.IsValid)
     {
         repository.AddAbout(AboutSelf);
         return View();
     }
     else
     {
         PrepareView();
         return View("Index", result);
     }
 }
Ejemplo n.º 2
0
 public void AddAbout(AboutSelf about)
 {
     if (!AboutExist(about.UserId))  //dosen't exist
     {
         db.AboutSelf.Add(about);
         db.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public AboutSelfFormViewModel(MyBlogRepository repository)
 {
     AboutSelf = new AboutSelf();
     genderText = new List<String> { "мужской", "женский" };
     hobbyText = new List<String> { "спорт", "видеоигры", "коллекционирование", "йога" };
 }