Exemple #1
0
        public ActionResult Edit(int id)
        {
            var dao      = new DichVuDao();
            var quyenhan = dao.ViewDentail(id);

            return(View(quyenhan));
        }
Exemple #2
0
        public ActionResult Edit(int id)
        {
            var dao    = new DichVuDao();
            var DichVu = dao.ViewDentail(id);

            return(View(DichVu));
        }
Exemple #3
0
        // GET: Admin/DichVu
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new DichVuDao();
            var model = dao.LayTatCaDS(searchString, page, pageSize);

            ViewBag.SearchString = searchString;
            return(View(model));
        }
Exemple #4
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            bool c = new DichVuDao().updateDV(new DICHVU {
                MaDV = Int32.Parse(txtMaDV.Text), TenDichVu = txtTenDV.Text, Gia = float.Parse(txtGia.Text)
            });

            if (c)
            {
                MessageBox.Show("Cập nhật thành công !");
                dgvDV.DataSource = new DichVuDao().DSDV();
            }
            else
            {
                MessageBox.Show("Cập nhật thất bại !");
            }
        }
Exemple #5
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            int c = new DichVuDao().addDV(new DICHVU {
                MaDV = Int32.Parse(txtMaDV.Text), TenDichVu = txtTenDV.Text, Gia = float.Parse(txtGia.Text)
            });

            if (c > 0)
            {
                MessageBox.Show("Thêm thành công !");
                dgvDV.DataSource = new DichVuDao().DSDV();
            }
            else
            {
                MessageBox.Show("Thêm không thành công !");
            }
        }
Exemple #6
0
 public ActionResult Edit(DichVu qh)
 {
     if (ModelState.IsValid)
     {
         var dao    = new DichVuDao();
         var result = dao.ChinhSua(qh);
         if (result)
         {
             //SetAlert("Cập nhật thành công", "success");
             return(RedirectToAction("Index", "DichVu"));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhật thất bại");
         }
     }
     return(View("Index"));
 }
Exemple #7
0
 public ActionResult ThemMoi(DichVu DichVu)
 {
     if (DichVu.TenDichVu != null)
     {
         var dao = new DichVuDao();
         int id  = dao.ThemMoi(DichVu);
         if (id > 0)
         {
             //SetAlert("Thêm quyền thành công", "success");
             return(RedirectToAction("Index", "DichVu"));
         }
         else
         {
             return(RedirectToAction("ThemMoi", "DichVu"));
         }
     }
     return(View());
 }
Exemple #8
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            bool c = new DichVuDao().xoaDV(Int32.Parse(txtMaDV.Text));

            if (c)
            {
                MessageBox.Show("Xóa thành công !");
                txtMaDV.Text  = "";
                txtTenDV.Text = "";
                txtGia.Text   = "";

                dgvDV.DataSource = new DichVuDao().DSDV();
            }
            else
            {
                MessageBox.Show("Xóa không thành công !");
            }
        }
Exemple #9
0
        public ActionResult Edit(DichVu dichvu)
        {
            if (ModelState.IsValid)
            {
                var dao = new DichVuDao();

                var result = dao.CapNhat(dichvu);

                if (result)
                {
                    return(RedirectToAction("Index", "DichVu"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật dịch vụ không thành công !");
                }
            }
            return(View("Index"));
        }
Exemple #10
0
        public ActionResult Create(DichVu dichvu)
        {
            if (ModelState.IsValid)
            {
                var dao = new DichVuDao();



                long id = dao.Them(dichvu);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "DichVu"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm dịch vụ không thành công !");
                }
            }
            return(View("Index"));
        }
Exemple #11
0
        public void Load()
        {
            DataTable da = new DichVuDao().DSDV();

            dgvDV.DataSource = da;
        }
Exemple #12
0
        public ActionResult Edit(int id)
        {
            var dichvu = new DichVuDao().ViewDetail(id);

            return(View(dichvu));
        }