public ActionResult delete(int id, int cid, int menuid) { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); EmpContactService objService = new EmpContactService(); List<EmpContactItem> lstItem = new List<EmpContactItem>(); EmpContactItem objDoc = new EmpContactItem(); objDoc = objService.GetById(cid); db.EmployeeContacts.Remove(db.EmployeeContacts.Find(cid)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; return RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }); }
public ActionResult View(int id, int cid) { EmpContactService objContactService = new EmpContactService(); EmpContactItem objContactitem = new EmpContactItem(); objContactitem = objContactService.GetById(cid); Session["Empid"] = objContactitem.EmpId; List<EmpContactItem> lstEmpContcts = new List<EmpContactItem>(); objContactitem.ListContactdetails = new List<EmpContactItem>(); objContactitem.ListContactdetails.AddRange(lstEmpContcts); #region Bind DropDown Country List<clsMasterData> lstMasters = new List<clsMasterData>(); lstMasters = objContactService.getCountry(); objContactitem.ListMaster = new List<clsMasterData>(); objContactitem.ListMaster.AddRange(lstMasters); #endregion ViewBag.Cid = cid; ViewBag.Menuid = Request.QueryString["menuId"]; return View(objContactitem); }