Beispiel #1
0
        public bool ThemHoaDon(ref string err, string MaHD, string MaBan, string MaNV, DateTime NgayLapHD, double PhuThu, double VAT, bool DaThanhToan)
        {
            try
            {
                var hd = new HoaDon()
                {
                    MaHD        = MaHD,
                    MaBan       = MaBan,
                    MaNV        = MaNV,
                    NgayLapHD   = NgayLapHD,
                    PhuThu      = PhuThu,
                    VAT         = VAT,
                    DaThanhToan = DaThanhToan
                };

                db.HoaDon.Add(hd);
                db.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                err = ex.Message;
                return(false);
            }
        }
Beispiel #2
0
        public void CapNhat(NhanVien nv0)
        {
            try
            {
                NhanVien nv = db.NhanVien.Find(nv0.MaNV);
                if (nv != null)
                {
                    nv.MaNV       = nv0.MaNV;
                    nv.HoTen      = nv0.HoTen;
                    nv.NgaySinh   = nv0.NgaySinh;
                    nv.Phai       = nv0.Phai;
                    nv.CMND       = nv0.CMND;
                    nv.SDT        = nv0.SDT;
                    nv.DiaChi     = nv0.DiaChi;
                    nv.NgayVaoLam = nv0.NgayVaoLam;
                    nv.MatKhau    = nv0.MatKhau;
                    nv.Quyen      = nv0.Quyen;
                    nv.Status     = nv0.Status;

                    db.SaveChanges();
                }
            }
            catch
            {
            }
        }
Beispiel #3
0
 public void Xoa(string MaNV, string MaCa, string MaKV)
 {
     try
     {
         PhanCong pc = db.PhanCong.Find(MaNV, MaCa, MaKV);
         if (pc != null)
         {
             db.PhanCong.Remove(pc);
             db.SaveChanges();
         }
     }
     catch
     {
     }
 }
 public void Xoa(string MaPhieuChi)
 {
     try
     {
         PhieuChi pc = db.PhieuChi.Find(MaPhieuChi);
         if (pc != null)
         {
             db.PhieuChi.Remove(pc);
             db.SaveChanges();
         }
     }
     catch
     {
     }
 }
Beispiel #5
0
        public void CapNhatTinhTrangCuaBan(string MaBan, bool TinhTrang)
        {
            try
            {
                Ban b = db.Ban.Find(MaBan);
                if (b != null)
                {
                    b.TinhTrang = TinhTrang;

                    db.SaveChanges();
                }
            }
            catch
            {
            }
        }
 public void ThemLoaiMon(LoaiMon lm)
 {
     try
     {
         var l = new LoaiMon()
         {
             MaLoaiMon  = lm.MaLoaiMon,
             TenLoaiMon = lm.TenLoaiMon
         };
         db.LoaiMon.Add(l);
         db.SaveChanges();
     }
     catch
     {
     }
 }
 public void Them(KhuVuc kv)
 {
     try
     {
         var k = new KhuVuc()
         {
             MaKV  = kv.MaKV,
             TenKV = kv.TenKV
         };
         db.KhuVuc.Add(k);
         db.SaveChanges();
     }
     catch
     {
     }
 }
 public void Them(CaLamViec ca)
 {
     try
     {
         var c = new CaLamViec()
         {
             MaCa       = ca.MaCa,
             TenCa      = ca.TenCa,
             GioBatDau  = ca.GioBatDau,
             GioKetThuc = ca.GioKetThuc,
             MucLuong   = ca.MucLuong
         };
         db.CaLamViec.Add(c);
         db.SaveChanges();
     }
     catch
     {
     }
 }
Beispiel #9
0
 public void ThemLichSu(LichSuHoatDong ls)
 {
     try
     {
         var l = new LichSuHoatDong()
         {
             MaLichSu  = ls.MaLichSu,
             MaNV      = ls.MaNV,
             HoTen     = ls.HoTen,
             HoatDong  = ls.HoatDong,
             ThoiGian  = ls.ThoiGian,
             TinhTrang = ls.TinhTrang
         };
         db.LichSuHoatDong.Add(l);
         db.SaveChanges();
     }
     catch
     {
     }
 }
        public void CapNhat(string TenQuan, string DiaChi, string SDT, string Email, byte[] HinhAnh)
        {
            try
            {
                ThongTinQuan tt = db.ThongTinQuan.Find("0");
                if (tt != null)
                {
                    tt.TenQuan = TenQuan;
                    tt.DiaChi  = DiaChi;
                    tt.SDT     = SDT;
                    tt.Email   = Email;
                    tt.HinhAnh = HinhAnh;

                    db.SaveChanges();
                }
            }
            catch
            {
            }
        }
Beispiel #11
0
        //Cập nhật
        public void CapNhat(ChamCong cc)
        {
            try
            {
                ChamCong c = db.ChamCong.Find(cc.ID, cc.MaNV, cc.MaCa, cc.MaKV);
                if (c != null)
                {
                    c.ID        = cc.ID;
                    c.MaNV      = cc.MaNV;
                    c.MaCa      = cc.MaCa;
                    c.MaKV      = cc.MaKV;
                    c.Thang     = cc.Thang;
                    c.Nam       = cc.Nam;
                    c.TinhTrang = cc.TinhTrang;

                    db.SaveChanges();
                }
            }
            catch
            {
            }
        }
        public bool ThemChiTietHoaDon(string MaHD, string MaMon, double DonGia, int SoLuong, string GhiChu)
        {
            try
            {
                var ct = new ChiTietHoaDon()
                {
                    MaHD    = MaHD,
                    MaMon   = MaMon,
                    DonGia  = DonGia,
                    SoLuong = SoLuong,
                    GhiChu  = GhiChu
                };

                db.ChiTietHoaDon.Add(ct);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #13
0
        public bool ThemMon(Mon mon)
        {
            try
            {
                var m = new Mon()
                {
                    MaMon     = mon.MaMon,
                    MaLoaiMon = mon.MaLoaiMon,
                    TenMon    = mon.TenMon,
                    SoLuong   = mon.SoLuong,
                    DonGia    = mon.DonGia,
                    GiaNhap   = mon.GiaNhap
                };

                db.Mon.Add(m);
                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }