// GET: Delete
        public ActionResult Index(int id)
        {
            EMPModelView empl = new EMPModelView();

            empl.Getdelete(id);
            return(RedirectToAction("index", "Home"));
        }
        // GET: Home
        public ActionResult Index()
        {
            EMPModelView emplview = new EMPModelView();
            List <EMP>   emp      = emplview.GEtdb();

            return(View(emp));
        }
        // GET: Details
        public ActionResult Index(int id)
        {
            EMPModelView empl     = new EMPModelView();
            EMP          employee = empl.EmployeeDetails(id);

            return(View(employee));
        }
        public ActionResult Index(EMP emp)
        {
            if (ModelState.IsValid)
            {
                EMPModelView empl = new EMPModelView();
                empl.AddNewEmployee(emp);

                //////////////////Dept Number Drop Down//////////////////
                var list = new List <DeptDropDown>();

                OracleConnection con = new OracleConnection(oradb);
                OracleCommand    cmd = new OracleCommand();
                cmd.CommandText = "Select d.deptno,d.dname From dept d";
                cmd.Connection  = con;
                con.Open();

                OracleDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    list.Add(new DeptDropDown
                    {
                        Deptid = reader.GetInt16(0),
                        Dname  = reader.GetString(1)
                    });
                }
                var model = new DeptModellist();
                ViewBag.drop = new SelectList(list, "deptid", "dname");
                //////////////////Dept Number Drop Down//////////////////


                return(RedirectToAction("index", "Home"));
            }
            return(View());
        }
コード例 #5
0
        public ActionResult Index(EMP emp)
        {
            if (ModelState.IsValid)
            {
                EMPModelView empl = new EMPModelView();
                empl.updateemp(emp);

                return(RedirectToAction("index", "Home"));
            }
            return(View());
        }