public ActionResult View(int id, int VId) { objVisas = new EmpVisaService(); EmpVisaItem objVisaItem = new EmpVisaItem(); objVisaItem = objVisas.GetById(VId); //ViewBag.empid = objVisaItem.EmpId; //Session["Empid"] = objPassItem.EmpId; List <EmpVisaItem> lstPassport = new List <EmpVisaItem>(); objVisaItem.ListVisa = new List <EmpVisaItem>(); objVisaItem.ListVisa.AddRange(lstPassport); List <clsMasterData> lstMData = new List <clsMasterData>(); lstMData = objVisas.GetVisaStatus(); objVisaItem.ListVisa = new List <EmpVisaItem>(); objVisaItem.ListVisa.AddRange(lstPassport); objVisaItem.MasterDetails = new List <clsMasterData>(); objVisaItem.MasterDetails.AddRange(lstMData); ViewBag.Menuid = Request.QueryString["menuId"]; #region Bind DropDown Country List <clsMasterData> lstMasters = new List <clsMasterData>(); lstMasters = objVisas.getCountry(); objVisaItem.ListCountry = new List <clsMasterData>(); objVisaItem.ListCountry.AddRange(lstMasters); #endregion #region For Emirates Bind List <clsMasterData> lstEmirates = new List <clsMasterData>(); lstEmirates = objVisas.GetEmiratesStatus(); objVisaItem.EmiratesList = new List <clsMasterData>(); objVisaItem.EmiratesList.AddRange(lstEmirates); #endregion #region ddl company List <CompanyItem> objCompany = new List <CompanyItem>(); CompanyService objListCompany = new CompanyService(); objCompany = objListCompany.GetALL(); EmployeeItem objEmpItem = new EmployeeItem(); objVisaItem.ListComp = new List <CompanyItem>(); objVisaItem.ListComp.AddRange(objCompany); #endregion #region ddl visa type List <clsMasterData> lstMData1 = new List <clsMasterData>(); lstMData1 = objVisas.GetVisaType(); objVisaItem.ListVisaType = new List <clsMasterData>(); objVisaItem.ListVisaType.AddRange(lstMData1); #endregion return(View(objVisaItem)); }
public ActionResult delete(int id, int VId, int menuid) { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); EmpVisaService objService = new EmpVisaService(); List <EmpVisaItem> lstItem = new List <EmpVisaItem>(); EmpVisaItem objDoc = new EmpVisaItem(); objDoc = objService.GetById(VId); db.EmployeeVisas.Remove(db.EmployeeVisas.Find(VId)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] })); }