Example #1
0
        public ActionResult Edit(int id, Modelss.Model.DichVu dichvu)
        {
            try
            {
                // TODO: Add update logic here

                Modelss.Model.DichVu tk = qltc.DichVus.Single(d => d.MaDichVu == id);

                tk.TenDichVu = dichvu.TenDichVu;
                tk.LoaiDichVu1.TenLoaiDichVu = dichvu.LoaiDichVu1.TenLoaiDichVu;
                tk.GhiChu    = dichvu.GhiChu;
                tk.GiaTien   = dichvu.GiaTien;
                tk.MoTa      = dichvu.MoTa;
                tk.TrangThai = dichvu.TrangThai;

                qltc.SubmitChanges();


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        public ActionResult Delete(int id, Modelss.Model.DichVu dv)
        {
            try
            {
                // TODO: Add delete logic here
                var tk = qltc.DichVus.Single(d => d.MaDichVu == id);
                qltc.DichVus.DeleteOnSubmit(tk);
                qltc.SubmitChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }