Exemplo n.º 1
0
        public ActionResult View(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));
        }
Exemplo n.º 2
0
        public ActionResult delete(int id, int PId, int menuid)
        {
            //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            EmpPassportService     objService = new EmpPassportService();
            List <EmpPassportItem> lstItem    = new List <EmpPassportItem>();
            EmpPassportItem        objDoc     = new EmpPassportItem();

            objDoc = objService.GetById(PId);
            db.EmployeePassports.Remove(db.EmployeePassports.Find(PId));
            db.SaveChanges();

            //ViewBag.Empid = Empid;
            ViewBag.Menuid = Request.QueryString["menuId"];

            return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }));
        }