private void editCategoryToolStripMenuItemMainMenu_Click(object sender, EventArgs e) { EditCategoryForm newForm = new EditCategoryForm(); newForm.StartPosition = FormStartPosition.CenterScreen; newForm.ShowDialog(); }
public ActionResult EditCategory(EditCategoryForm editCategoryForm) { if (ModelState.IsValid) { var category = Mapper.Map <Category>(editCategoryForm); categoryRepository.AddOrUpdate(category); return(RedirectToAction("Posts", "Blog")); } else { return(View(editCategoryForm)); } }