Exemplo n.º 1
0
        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"));
            }
        }
Exemplo n.º 2
0
        public ActionResult KieuPhong()
        {
            var t     = new Models.KieuPhongModel();
            var model = t.getAllKieuPhong();

            return(View(model));
        }
Exemplo n.º 3
0
        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"));
            }
        }