Example #1
0
        public ActionResult ThemGiaoVienPost()
        {
            if (!HttpContext.User.Identity.IsAuthenticated)
            {
                return RedirectToAction("DanhSachGiaoVien", "GiaoVien");
            }
            G9Service.GiaoVien gv = new G9Service.GiaoVien();
            gv.TenGiaoVien = HttpContext.Request["txtTenGiaoVien"];
            gv.GioiTinh = HttpContext.Request["txtGioiTinh"];
            gv.DiaChi = HttpContext.Request["txtDiaChi"];
            gv.DienThoai = HttpContext.Request["txtDienThoai"];
            gv.Email = HttpContext.Request["txtMonHoc"];

            G9Service.G9_Service ws = new G9Service.G9_Service();
            bool result = ws.ThemGiaoVien(gv);

            return (result == true) ? RedirectToAction("DanhSachGiaoVien", "GiaoVien") : RedirectToAction("ThemGiaoVien", "GiaoVien");
        }