public ActionResult Edit(int id) { var dao = new DichVuDao(); var quyenhan = dao.ViewDentail(id); return(View(quyenhan)); }
public ActionResult Edit(int id) { var dao = new DichVuDao(); var DichVu = dao.ViewDentail(id); return(View(DichVu)); }
// 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)); }
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 !"); } }
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 !"); } }
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")); }
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()); }
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 !"); } }
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")); }
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")); }
public void Load() { DataTable da = new DichVuDao().DSDV(); dgvDV.DataSource = da; }
public ActionResult Edit(int id) { var dichvu = new DichVuDao().ViewDetail(id); return(View(dichvu)); }