public ActionResult DeleteConfirmed(int id)
        {
            EmpAddressDet empAddressDet = db.EmpAddressDets.Find(id);

            db.EmpAddressDets.Remove(empAddressDet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "AddressID,Address1,Address2,EmployeeID,StateID,PinCode")] EmpAddressDet empAddressDet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(empAddressDet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.EmployeeMsts, "EmployeeID", "FirstName", empAddressDet.EmployeeID);
     ViewBag.StateID    = new SelectList(db.StateMsts, "StateID", "State_Name", empAddressDet.StateID);
     return(View(empAddressDet));
 }
        // GET: EmpAddressDets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmpAddressDet empAddressDet = db.EmpAddressDets.Find(id);

            if (empAddressDet == null)
            {
                return(HttpNotFound());
            }
            return(View(empAddressDet));
        }
        // GET: EmpAddressDets/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmpAddressDet empAddressDet = db.EmpAddressDets.Find(id);

            if (empAddressDet == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeID = new SelectList(db.EmployeeMsts, "EmployeeID", "FirstName", empAddressDet.EmployeeID);
            ViewBag.StateID    = new SelectList(db.StateMsts, "StateID", "State_Name", empAddressDet.StateID);
            return(View(empAddressDet));
        }