public ActionResult Edit(int id, int PasId) { EmpPassportService objPassService = new EmpPassportService(); EmpPassportItem objPassItem = new EmpPassportItem(); objPassItem = objPassService.GetById(PasId); //Session["Empid"] = objPassItem.EmpId; List <EmpPassportItem> lstPassport = new List <EmpPassportItem>(); objPassItem.ListPassport = new List <EmpPassportItem>(); objPassItem.ListPassport.AddRange(lstPassport); #region Bind DropDown Nationality List <clsMasterData> lstMasters = new List <clsMasterData>(); lstMasters = objpassport.getNationality(); objPassItem.ListNationality = new List <clsMasterData>(); objPassItem.ListNationality.AddRange(lstMasters); #endregion #region Bind DropDown Country //List<clsMasterData> lstMasters = new List<clsMasterData>(); lstMasters = objpassport.getCountry(); objPassItem.ListCountry = new List <clsMasterData>(); objPassItem.ListCountry.AddRange(lstMasters); #endregion ViewBag.PId = PasId; ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objPassItem)); }
public ActionResult Create() { int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); objpassport = new EmpPassportService(); List <EmpPassportItem> listRel = new List <EmpPassportItem>(); listRel = objpassport.PassportListData(Empid); ViewBag.Empid = Empid; EmpPassportItem objPasitem = new EmpPassportItem(); objPasitem.ListPassport = new List <EmpPassportItem>(); objPasitem.ListPassport.AddRange(listRel); listRel = objpassport.GetPassportDoc(Empid); objPasitem.ListPassportDoc = new List <EmpPassportItem>(); objPasitem.ListPassportDoc.AddRange(listRel); #region Bind DropDown Nationality List <clsMasterData> lstMasters = new List <clsMasterData>(); lstMasters = objpassport.getNationality(); objPasitem.ListNationality = new List <clsMasterData>(); objPasitem.ListNationality.AddRange(lstMasters); #endregion #region Bind DropDown Country //List<clsMasterData> lstMasters = new List<clsMasterData>(); lstMasters = objpassport.getCountry(); objPasitem.ListCountry = new List <clsMasterData>(); objPasitem.ListCountry.AddRange(lstMasters); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objPasitem)); }