コード例 #1
0
ファイル: PhongController.cs プロジェクト: daibx/tkb-g9
        public ActionResult ThemPhongPost()
        {
            if (!HttpContext.User.Identity.IsAuthenticated)
            {
                return RedirectToAction("DanhSachPhong", "Phong");
            }
            G9Service.Phong gv = new G9Service.Phong();
            gv.TenPhong = HttpContext.Request["txtTenPhong"];
            gv.TinhTrang = HttpContext.Request["txtTinhTrang"];
            gv.SucChua = Int32.Parse(HttpContext.Request["txtSucChua"]);

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

            return (result == true) ? RedirectToAction("DanhSachPhong", "Phong") : RedirectToAction("ThemPhong", "Phong");
        }