Esempio n. 1
0
        public void XoaChamCong(string MaNV, DateTime NgayLam, string Ca)
        {
            CHAMCONG cc = new CHAMCONG();

            cc.MANHANVIEN = MaNV;
            cc.NGAYLAM    = NgayLam;
            cc.CA         = Ca;
            cf.CHAMCONGs.Attach(cc);
            cf.CHAMCONGs.Remove(cc);
            cf.SaveChanges();
        }
Esempio n. 2
0
        public void XoaLM(string MLM)
        {
            CafeEntities cf = new CafeEntities();
            LOAIMON      lm = new LOAIMON();

            lm.MALOAIMON = MLM;
            cf.LOAIMONs.Attach(lm);
            cf.LOAIMONs.Remove(lm);
            cf.SaveChanges();
        }
Esempio n. 3
0
        public void ThemLM(string MLM, string TLM)
        {
            CafeEntities cf = new CafeEntities();
            LOAIMON      lm = new LOAIMON();

            lm.MALOAIMON  = MLM;
            lm.TENLOAIMON = TLM;
            cf.LOAIMONs.Add(lm);
            cf.SaveChanges();
        }
Esempio n. 4
0
        public void XoaNV(string Manv)
        {
            CafeEntities cafe = new CafeEntities();
            NHANVIEN     nv   = new NHANVIEN();

            nv.MANHANVIEN = Manv;
            cafe.NHANVIENs.Attach(nv);
            cafe.NHANVIENs.Remove(nv);
            cafe.SaveChanges();
        }
Esempio n. 5
0
        public void SuaLM(string MLM, string TLM)
        {
            CafeEntities cf = new CafeEntities();
            var          lm = (from a in cf.LOAIMONs where a.MALOAIMON == MLM select a).SingleOrDefault();

            if (lm != null)
            {
                lm.TENLOAIMON = TLM;
                cf.SaveChanges();
            }
        }
Esempio n. 6
0
        public void ThemNV(string MNV, string HT, string PH, DateTime NS, string DC, string SDT, DateTime NVL, string LCB)
        {
            CafeEntities cf = new CafeEntities();
            NHANVIEN     nv = new NHANVIEN();

            nv.MANHANVIEN = MNV;
            nv.HOTEN      = HT;
            nv.PHAI       = PH;
            nv.NGAYSINH   = NS;
            nv.DIACHI     = DC;
            nv.SDT        = SDT;
            nv.NGAYVAOLAM = NVL;
            nv.LUONGCOBAN = int.Parse(LCB);
            cf.NHANVIENs.Add(nv);
            cf.SaveChanges();
        }
Esempio n. 7
0
        public void SuaNV(string MNV, string HT, string PH, DateTime NS, string DC, string SDT, DateTime NVL, string LCB)
        {
            CafeEntities snv = new CafeEntities();
            //var nv = (from a in snv.NHANVIENs where a.MANHANVIEN == MNV select a).SingleOrDefault();
            var nv1 = cf.NHANVIENs.Where(p => p.MANHANVIEN.Equals(MNV)).SingleOrDefault();

            if (nv1 != null)
            {
                nv1.HOTEN      = HT;
                nv1.PHAI       = PH;
                nv1.NGAYSINH   = NS;
                nv1.DIACHI     = DC;
                nv1.SDT        = SDT;
                nv1.NGAYVAOLAM = NVL;
                nv1.LUONGCOBAN = int.Parse(LCB);
                snv.SaveChanges();
            }
        }