public bool InsertNhaCC(string maNCC, string tenNCC, string diaChi, string sdt) { try { NhaCungCap ncc = new NhaCungCap { MaNCC = maNCC, TenNCC = tenNCC, DiaChi = diaChi, SDT = sdt, }; context.NhaCungCaps.Add(ncc); context.SaveChanges(); return(true); } catch { return(false); } }
// Cap nhat nhacc public static bool UpdateNhaCC(NhaCungCap _cc) { try { using (var db = new SieuThiDBDataContext()) { var cc = db.NhaCungCaps.Single(x => x.MaNCC == _cc.MaNCC); cc.TenNCC = _cc.TenNCC; cc.DiaChi = _cc.DiaChi; cc.DienThoai = _cc.DienThoai; cc.MaSoThue = _cc.MaSoThue; cc.Fax = _cc.Fax; db.SubmitChanges(); return(true); } } catch { return(false); } }
// Tạo nhacc public static bool CreateNhaCC(NhaCungCap cc) { try { using (SieuThiDBDataContext db = new SieuThiDBDataContext()) { var cc1 = new NhaCungCap(); cc1.TenNCC = cc.TenNCC ?? ""; cc1.MaNCC = cc.MaNCC; cc1.DiaChi = cc.DiaChi; cc1.DienThoai = cc.DienThoai; cc1.MaSoThue = cc.MaSoThue; cc1.Fax = cc.Fax; db.NhaCungCaps.InsertOnSubmit(cc1); db.SubmitChanges(); return(true); } } catch { return(false); } }
public bool XoaNCC(NhaCungCap ncc) { return(nccDAL.XoaNhaCungCap(ncc)); }
public bool CapNhatNCC(NhaCungCap ncc) { return(nccDAL.CapNhatNhaCungCap(ncc)); }
public bool ThemNCC(NhaCungCap ncc) { return(nccDAL.ThemNhaCungCap(ncc)); }
public bool CapNhatNhaCungCap(NhaCungCap ncc) { return(da.CapNhatNhaCungCap(ncc)); }
public bool ThemNhaCungCap(NhaCungCap ncc) { return(da.ThemNhaCungCap(ncc)); }
public void EditData(NhaCungCap ex) { bus.EditData(ex); }
public static bool update(NhaCungCap ncc) { return(NhaCungCap_DAO.update(ncc)); }
public static bool insert(NhaCungCap ncc) { return(NhaCungCap_DAO.insert(ncc)); }
public bool updateNhaCungCap(NhaCungCap nhacungcap) { return(objNCC.updateNhanVien(nhacungcap)); }
public bool addNCC(NhaCungCap nhacungcap) { return(objNCC.addNhaCungCap(nhacungcap)); }
public void DeleteData(NhaCungCap ex) { bus.DeleteData(ex); }
public bool Them(NhaCungCap nhaCungCap) { return(dal_nhaCungCap.Them(nhaCungCap)); }
public bool CapNhat(NhaCungCap nhaCungCap) { return(dal_nhaCungCap.CapNhat(nhaCungCap)); }
// THEM DATA public void AddData(NhaCungCap ex) { bus.AddData(ex); }