Esempio n. 1
0
        public static void Sua(string MaNCC, string TenNCC, string MaKhuVuc, string DiaChi, int MaSoThue, string DienThoai, string Mobile, string Email, string TaiKhoan, int GioiHanNo, int Fax, string NganHang, string Website, int NoHienTai, string ChucVu, string NguoiLienHe, int ChietKhau, bool ConQuanLy)
        {
            var        db = new PerfectAppEntities();
            NhaCungCap n  = db.NhaCungCaps.FirstOrDefault(p => p.MaNCC == MaNCC);

            n.MaNCC       = MaNCC;
            n.TenNCC      = TenNCC;
            n.MaKhuVuc    = MaKhuVuc;
            n.DiaChi      = DiaChi;
            n.MaSoThue    = MaSoThue;
            n.DienThoai   = DienThoai;
            n.Mobile      = Mobile;
            n.Email       = Email;
            n.Website     = Website;
            n.NganHang    = NganHang;
            n.TaiKhoan    = TaiKhoan;
            n.NguoiLienHe = NguoiLienHe;
            n.NoHienTai   = NoHienTai;
            n.GioiHanNo   = GioiHanNo;
            n.Fax         = Fax;
            n.ChietKhau   = ChietKhau;
            n.ConQuanLy   = ConQuanLy;
            n.ChucVu      = ChucVu;
            n.MaSoThue    = MaSoThue;
            db.SaveChanges();
        }
Esempio n. 2
0
        public static void Xoa(string Ma)
        {
            var db = new PerfectAppEntities();
            var rs = db.KhuVucs.Where(k => k.MaKhuVuc == Ma).First();

            db.KhuVucs.Remove(rs);
            db.SaveChanges();
        }
Esempio n. 3
0
        public static void Xoa(string MaHang)
        {
            var     db = new PerfectAppEntities();
            HangHoa hh = db.HangHoas.FirstOrDefault(h => h.MaHang == MaHang);

            db.HangHoas.Remove(hh);
            db.SaveChanges();
        }
Esempio n. 4
0
        public static void Xoa(string MaKH)
        {
            var       db = new PerfectAppEntities();
            KhachHang kh = db.KhachHangs.Where(k => k.MaKH == MaKH).First();

            db.KhachHangs.Remove(kh);
            db.SaveChanges();
        }
Esempio n. 5
0
        public static void Sua(string Ma, string Ten, string GhiChu, bool ConQuanLy)
        {
            var db = new PerfectAppEntities();
            var rs = db.KhuVucs.Where(k => k.MaKhuVuc == Ma).First();

            rs.TenKhuVuc = Ten;
            rs.GhiChu    = GhiChu;
            rs.ConQuanLy = ConQuanLy;
            db.SaveChanges();
        }
Esempio n. 6
0
        public static void Them(string Ma, string Ten, string GhiChu, bool ConQuanLy)
        {
            KhuVuc kv = new KhuVuc();

            kv.MaKhuVuc  = Ma;
            kv.TenKhuVuc = Ten;
            kv.GhiChu    = GhiChu;
            kv.ConQuanLy = ConQuanLy;
            var db = new PerfectAppEntities();

            db.KhuVucs.Add(kv);
            db.SaveChanges();
        }
Esempio n. 7
0
        public static void Them(string MaPhieu, string MaHang, string MaDonVi, int SoLuong, double DonGia, string GhiChu)
        {
            var db = new PerfectAppEntities();
            ChiTietPhieuNhapHang ct = new ChiTietPhieuNhapHang();

            ct.MaPhieu = MaPhieu;
            ct.MaHang  = MaHang;
            ct.MaDonVi = MaDonVi;
            ct.SoLuong = SoLuong;
            ct.DonGia  = DonGia;
            ct.GhiChu  = GhiChu;
            db.ChiTietPhieuNhapHangs.Add(ct);
            db.SaveChanges();
        }
Esempio n. 8
0
        public static void Sua(string MaKH, string MaKV, string TenKH, string DiaChi, string MaSoThue, string DienThoai, string Email, string TaiKhoan, int GioiHanNo, int NoHienTai, string NganHang, string NguoiLienHe, bool ConQuanLy)
        {
            var       db = new PerfectAppEntities();
            KhachHang kh = db.KhachHangs.Where(k => k.MaKH == MaKH).First();

            kh.MaKH        = MaKH;
            kh.MaKhuVuc    = MaKV;
            kh.TenKH       = TenKH;
            kh.DiaChi      = DiaChi;
            kh.MaSoThue    = MaSoThue;
            kh.DienThoai   = DienThoai;
            kh.Email       = Email;
            kh.TaiKhoan    = TaiKhoan;
            kh.GioiHanNo   = GioiHanNo;
            kh.NoHienTai   = NoHienTai;
            kh.NganHang    = NganHang;
            kh.NguoiLienHe = NguoiLienHe;
            kh.ConQuanLy   = ConQuanLy;
            db.SaveChanges();
        }
Esempio n. 9
0
        public static void Them(string MaPhieu, string MaNCC, string DiaChi, string DienThoai, DateTime Ngay, string GhiChu, string SoHoaDonVAT, string SoHoaDonVietTay, string MaNV, string MaKho, string MaDKTT, string MaHTTT, DateTime HTT)
        {
            var           db = new PerfectAppEntities();
            PhieuNhapHang a  = new PhieuNhapHang();

            a.MaPhieu         = MaPhieu;
            a.MaNCC           = MaNCC;
            a.DiaChi          = DiaChi;
            a.DienThoai       = DienThoai;
            a.Ngay            = Ngay;
            a.GhiChu          = GhiChu;
            a.SoHoaDonVAT     = SoHoaDonVAT;
            a.SoHoaDonVietTay = SoHoaDonVietTay;
            a.MaNV            = MaNV;
            a.MaKho           = MaKho;
            a.MaDKTT          = MaDKTT;
            a.MaHTTT          = MaHTTT;
            a.HanTT           = HTT;
            db.PhieuNhapHangs.Add(a);
            db.SaveChanges();
        }
Esempio n. 10
0
        public static void Sua(string MaHang, string TenHang, string MaPhanLoaiHangHoa, string MaLoaiHangHoa, string MaKho, string MaVach, string MaDonVi, string MaNhaCC, string XuatXu, int TonKhoToiThieu, int TonKhoHienTai, double GiaMua, double GiaBanLe, double GiaBanSi, bool ConQuanLy)
        {
            var     db = new PerfectAppEntities();
            HangHoa hh = db.HangHoas.FirstOrDefault(h => h.MaHang == MaHang);

            hh.MaHang         = MaHang;
            hh.TenHang        = TenHang;
            hh.MaPhanLoai     = MaPhanLoaiHangHoa;
            hh.MaLoaiHangHoa  = MaLoaiHangHoa;
            hh.MaKho          = MaKho;
            hh.MaVachNSX      = MaVach;
            hh.MaDV           = MaDonVi;
            hh.MaNCC          = MaNhaCC;
            hh.XuatXu         = XuatXu;
            hh.TonKhoToiThieu = TonKhoToiThieu;
            hh.TonHienTai     = TonKhoHienTai;
            hh.GiaMua         = GiaMua;
            hh.GiaBanSi       = GiaBanSi;
            hh.GiaBanLe       = GiaBanLe;
            hh.ConQuanLy      = ConQuanLy;
            db.SaveChanges();
        }