コード例 #1
0
 public ActionResult Edit(CategoryViewModel categoryModel)
 {
     if (ModelState.IsValid)
     {
         Category category = categoryModel.ToCategory();
         repository.InsertOrUpdate(category, User.Identity.Name);
         repository.Save();
         return RedirectToAction("Index");
     }
     return View(categoryModel);
 }
コード例 #2
0
        public Meeting ToMeeting()
        {
            Meeting meeting = new Meeting();

            CategoryViewModel categoryModel = new CategoryViewModel();
            categoryModel = this.Category;
            Category category = new Category();
            if (this.Category == null)
            {
                meeting.CategoryID = null;
            }
            else
            {
                category = categoryModel.ToCategory();
                meeting.CategoryID = category.CategoryID;
            }

            meeting.MeetingID = this.MeetingID;
            meeting.Time = this.Time;
            meeting.Description = this.Description;
            meeting.Place = this.Place;

            return meeting;
        }