コード例 #1
0
ファイル: PhongController.cs プロジェクト: hainguyentn94/VNPT
        public ActionResult capnhatkieu(DANH_MUC_KIEU_PHONG model)
        {
            model.MAKIEUPHONG  = int.Parse(Request["txtmakieup"].ToString());
            model.TENKIEUPHONG = Request["txttenkieup"].ToString();
            model.MOTA         = Request["txtmotakieup"].ToString();
            model.SONGUOILON   = Convert.ToInt32(Request["txttsonguoilonp"].ToString());
            model.SOTREEM      = Convert.ToInt32(Request["txttsotreemp"].ToString());

            if (model.TENKIEUPHONG != "" && model.MOTA != "" && model.SONGUOILON != null && model.SOTREEM != null)
            {
                var t      = new Models.KieuPhongModel();
                var result = t.updateKieuPhong(model.MAKIEUPHONG, model.TENKIEUPHONG, model.MOTA, model.SONGUOILON, model.SOTREEM);
                if (result)
                {
                    return(RedirectToAction("KieuPhong", "Phong"));
                }
                else
                {
                    return(RedirectToAction("KieuPhong", "Phong"));
                }
            }
            else
            {
                return(RedirectToAction("KieuPhong", "Phong"));
            }
        }
コード例 #2
0
ファイル: PhongController.cs プロジェクト: hainguyentn94/VNPT
        public ActionResult KieuPhong()
        {
            var t     = new Models.KieuPhongModel();
            var model = t.getAllKieuPhong();

            return(View(model));
        }
コード例 #3
0
ファイル: PhongController.cs プロジェクト: hainguyentn94/VNPT
        public ActionResult xoakieu(DANH_MUC_KIEU_PHONG model)
        {
            model.MAKIEUPHONG = int.Parse(Request["txtidk"].ToString());
            var t      = new Models.KieuPhongModel();
            var result = t.deleteKieuPhong(model.MAKIEUPHONG);

            if (result)
            {
                return(RedirectToAction("KieuPhong", "Phong"));
            }
            else
            {
                return(RedirectToAction("KieuPhong", "Phong"));
            }
        }