public ActionResult BookInfoEdit() { if (!string.IsNullOrEmpty(Request["id"])) { int id = int.Parse(Request["id"]); Books bookInfo = booksDAL.GetEntityModel(id); ViewData.Model = bookInfo; ViewData["type"] = "update"; } else { ViewData["type"] = "add"; } return(View()); }