Пример #1
0
        public ActionResult Create(EmployeeModel EmpObj)
        {
            int i = db.SaveEmployee(EmpObj);

            if (i > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
Пример #2
0
        public ActionResult Create(FormCollection frm)
        {
            EmployeeModel emp = new Models.EmployeeModel();

            emp.EmpName   = Convert.ToString(frm["EmpName"]);
            emp.EmpSalary = Convert.ToInt32(frm["EmpSalary"]);
            int i = db.SaveEmployee(emp);

            if (i > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }