public bool SuaLoaiDia(LoaiDia loaiDia) { string query = "UPDATE dbo.LoaiDia SET TenLoai = N'" + loaiDia.TenLoai + "' WHERE MaSo = " + loaiDia.MaSo; int result = DataProvider.Instance.ExecuteNonQuery(query); return(result > 0); }
private bool KiemTraLoaiDia(string maloaidia) { LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoaiDia == maloaidia).FirstOrDefault(); if (loaidia != null) { return(true); } return(false); }
public string LayTenLoaiDiaTheoMaLoai(string maloaidia) { LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoaiDia == maloaidia).FirstOrDefault(); if (loaidia == null) { return(null); } return(loaidia.TenLoaiDia); }
public ActionResult Create(LoaiDia loaidia) { if (ModelState.IsValid) { db.LoaiDias.Add(loaidia); db.SaveChanges(); return RedirectToAction("Index"); } return View(loaidia); }
public int ThietLapThoiGianThue(eLoaiDia loaiDia) { if (!KiemTraLoaiDia(loaiDia.maLoai)) { return(0); } LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoaiDia.Equals(loaiDia.maLoai)).FirstOrDefault(); loaidia.ThoiGianThue = loaiDia.thoiGianThue; db.SubmitChanges(); return(1); }
public eLoaiDia LayLoaiDiaTheoMa(string ma) { LoaiDia loai = db.LoaiDias.Where(x => x.MaLoaiDia.Equals(ma)).FirstOrDefault(); if (loai != null) { eLoaiDia eloai = new eLoaiDia(); eloai.maLoai = loai.MaLoaiDia; eloai.tenLoai = loai.TenLoaiDia; eloai.thoiGianThue = loai.ThoiGianThue; eloai.giaThue = loai.GiaThue; eloai.giaPhat = loai.GiaPhat; return(eloai); } return(null); }
public eLoaiDia LayLoaiDiaTheoDia(eDia dia) { TieuDe td = db.TieuDes.Where(x => x.MaTieuDe.Equals(dia.Matieude)).FirstOrDefault(); if (td != null) { LoaiDia loai = db.LoaiDias.Where(x => x.MaLoaiDia.Equals(td.MaLoaiDia)).FirstOrDefault(); if (loai != null) { eLoaiDia eloai = new eLoaiDia(); eloai.maLoai = loai.MaLoaiDia; eloai.tenLoai = loai.TenLoaiDia; eloai.thoiGianThue = loai.ThoiGianThue; eloai.giaThue = loai.GiaThue; eloai.giaPhat = loai.GiaPhat; return(eloai); } } return(null); }
public ActionResult Edit(LoaiDia loaidia) { if (ModelState.IsValid) { db.Entry(loaidia).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(loaidia); }
public decimal LayGia(string id) { LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoai == id).FirstOrDefault(); return(loaidia.GiaThue); }
public int SoNgayChoPhepThue(string id) { LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoai == id).FirstOrDefault(); return(loaidia.ThoiGianChoPhepThue); }
public string GetTenLoaiByID(string id) { LoaiDia loaidia = db.LoaiDias.Where(x => x.MaLoai == id).FirstOrDefault(); return(loaidia.TenLoai); }
public bool SuaLoaiDia(LoaiDia loaiDia) { return(LoaiDiaDAO.Instance.SuaLoaiDia(loaiDia)); }