public bool themnhomhang(string maloai, string tennhom) { try { banhangDataContext context = new banhangDataContext(); nhomhang lhmoi = new nhomhang(); lhmoi.maloai = maloai; lhmoi.tennhom = tennhom; context.nhomhangs.InsertOnSubmit(lhmoi); context.SubmitChanges(); return(true); } catch { } return(false); }
public bool suanoibac(int thutu, int mahang) { try { banhangDataContext context = new banhangDataContext(); noibac nb = context.noibacs.FirstOrDefault(x => x.thutu == thutu); if (nb != null) { nb.mahang = mahang; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool xoahanghoa(int mahang) { try { banhangDataContext context = new banhangDataContext(); hanghoa xoahh = context.hanghoas.FirstOrDefault(x => x.mahang == mahang); if (xoahh != null) { context.hanghoas.DeleteOnSubmit(xoahh); context.SubmitChanges(); return(true); } } catch { }; return(false); }
public bool doimatkhaunhanvien(string tknv, string mknv, string mkmoi) { try { banhangDataContext context = new banhangDataContext(); nhavien doimknv = context.nhaviens.FirstOrDefault(x => x.tknv == tknv && x.mknv == mknv); if (doimknv != null) { doimknv.mknv = mkmoi; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool doimatkhaukhachhang(string tkkh, string mkkh, string mkmoi) { try { banhangDataContext context = new banhangDataContext(); khachhang doimkkh = context.khachhangs.FirstOrDefault(x => x.tkkh == tkkh && x.mkkh == mkkh); if (doimkkh != null) { doimkkh.mkkh = mkmoi; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool huydonhang(int masodh) { try { banhangDataContext context = new banhangDataContext(); donhang dh = context.donhangs.FirstOrDefault(x => x.masodh == masodh); if (dh != null) { dh.tinhtrang = "huy"; context.SubmitChanges(); return(true); } } catch { }; return(false); }
public bool xoanhomhang(int manhom) { try { banhangDataContext context = new banhangDataContext(); nhomhang xoalh = context.nhomhangs.FirstOrDefault(x => x.manhom == manhom); if (xoalh != null) { context.nhomhangs.DeleteOnSubmit(xoalh); context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool hoanthanhdonhang(int masodh, string tknv2) { try { banhangDataContext context = new banhangDataContext(); donhang dh = context.donhangs.FirstOrDefault(x => x.masodh == masodh); if (dh != null) { dh.tinhtrang = "hoantat"; dh.tknv2 = tknv2; context.SubmitChanges(); return(true); } } catch { }; return(false); }
public bool suanhomhang(int manhom, string maloai, string tennhom) { try { banhangDataContext context = new banhangDataContext(); nhomhang sualh = context.nhomhangs.FirstOrDefault(x => x.manhom == manhom); if (sualh != null) { sualh.maloai = maloai; sualh.tennhom = tennhom; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool them(int masodh, int mahang, int soluong, int gia1sp) { try { banhangDataContext context = new banhangDataContext(); chitietdonhang themvaodh = new chitietdonhang(); themvaodh.masodh = masodh; themvaodh.mahang = mahang; themvaodh.soluong = soluong; themvaodh.giadathang1sp = gia1sp; context.chitietdonhangs.InsertOnSubmit(themvaodh); context.SubmitChanges(); return(true); } catch { }; return(false); }
public bool xoakhachhang(string tkkh) { { try { banhangDataContext context = new banhangDataContext(); khachhang xoakh = context.khachhangs.FirstOrDefault(x => x.tkkh == tkkh); if (xoakh != null) { context.khachhangs.DeleteOnSubmit(xoakh); context.SubmitChanges(); return(true); } } catch { } return(false); } }
public bool xoanhanvien(string tknv) { { try { banhangDataContext context = new banhangDataContext(); nhavien xoanv = context.nhaviens.FirstOrDefault(x => x.tknv == tknv); if (xoanv != null) { context.nhaviens.DeleteOnSubmit(xoanv); context.SubmitChanges(); return(true); } } catch { } return(false); } }
public bool themhanghoa(string maloai, int manhom, string tenhang, int gia, string hinh, string mota) { try { banhangDataContext context = new banhangDataContext(); hanghoa hhmoi = new hanghoa(); hhmoi.maloai = maloai; hhmoi.manhom = manhom; hhmoi.tenhang = tenhang; hhmoi.gia = gia; hhmoi.hinh = hinh; hhmoi.mota = mota; context.hanghoas.InsertOnSubmit(hhmoi); context.SubmitChanges(); return(true); } catch { }; return(false); }
public int themdonhang(string tkkh, DateTime ngaydathang, string diachi, string ghichu) { int id = 0; try { banhangDataContext context = new banhangDataContext(); donhang dhmoi = new donhang(); dhmoi.tkkh = tkkh; dhmoi.ngaydathang = ngaydathang; dhmoi.diachinhanhang = diachi; dhmoi.tinhtrang = "chuaxacnhan"; dhmoi.ghichu = ghichu; context.donhangs.InsertOnSubmit(dhmoi); context.SubmitChanges(); id = dhmoi.masodh; } catch { }; return(id); }
public bool suathongthongtinnhanvien(string tknv, string htnv, string gtnv, string dcnv, int sdtnv, int cmndnv) { try { banhangDataContext context = new banhangDataContext(); nhavien suanv = context.nhaviens.FirstOrDefault(x => x.tknv == tknv); if (suanv != null) { suanv.hotennv = htnv; suanv.gioitinhnv = gtnv; suanv.diachinv = dcnv; suanv.sdtnv = sdtnv; suanv.cmndnv = cmndnv; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool themnhanvien(string tknv, string mknv, string htnv, string gtnv, string dcnv, int sdtnv, int cmndnv) { try { banhangDataContext context = new banhangDataContext(); nhavien nvmoi = new nhavien(); nvmoi.tknv = tknv; nvmoi.mknv = mknv; nvmoi.hotennv = htnv; nvmoi.gioitinhnv = gtnv; nvmoi.diachinv = dcnv; nvmoi.sdtnv = sdtnv; nvmoi.cmndnv = cmndnv; context.nhaviens.InsertOnSubmit(nvmoi); context.SubmitChanges(); return(true); } catch { } return(false); }
public bool suathongthongtinkhachhang(string tkkh, string htkh, string gioitinhkh, string dckh, int sdtkh, int cmndkh) { try { banhangDataContext context = new banhangDataContext(); khachhang suakh = context.khachhangs.FirstOrDefault(x => x.tkkh == tkkh); if (suakh != null) { suakh.hotenkh = htkh; suakh.gioitinhkh = gioitinhkh; suakh.diachikh = dckh; suakh.sdtkh = sdtkh; suakh.cmndkh = cmndkh; context.SubmitChanges(); return(true); } } catch { } return(false); }
public bool them(string tkkh, string mkkh, string htkh, string gioitinhkh, string dckh, int sdtkh, int cmndkh) { try { banhangDataContext context = new banhangDataContext(); khachhang khmoi = new khachhang(); khmoi.tkkh = tkkh; khmoi.mkkh = mkkh; khmoi.hotenkh = htkh; khmoi.gioitinhkh = gioitinhkh; khmoi.diachikh = dckh; khmoi.sdtkh = sdtkh; khmoi.cmndkh = cmndkh; context.khachhangs.InsertOnSubmit(khmoi); context.SubmitChanges(); return(true); } catch { } return(false); }
public bool suahanghoa(int mahang, string maloai, int manhom, string tenhang, int gia, string hinh, string mota) { try { banhangDataContext context = new banhangDataContext(); hanghoa suahh = context.hanghoas.FirstOrDefault(x => x.mahang == mahang); if (suahh != null) { suahh.maloai = maloai; suahh.manhom = manhom; suahh.tenhang = tenhang; suahh.gia = gia; suahh.hinh = hinh; suahh.mota = mota; context.SubmitChanges(); return(true); } } catch { }; return(false); }
public int themdonhangtaicuahang(string tknv, DateTime ngaydathang) { int id = 0; try { banhangDataContext context = new banhangDataContext(); donhang dhmoi = new donhang(); dhmoi.tkkh = "muataicuahang"; dhmoi.tknv1 = tknv; dhmoi.tknv2 = tknv; dhmoi.ngaydathang = ngaydathang; dhmoi.tinhtrang = "muataicuahang"; dhmoi.diachinhanhang = "tai cua hang"; context.donhangs.InsertOnSubmit(dhmoi); context.SubmitChanges(); id = dhmoi.masodh; } catch { }; return(id); }