Ejemplo n.º 1
0
        public void insert(float tong, int soluongnhap)
        {
            PhieuNhapHang phieunhap = new PhieuNhapHang();

            phieunhap.TongTien    = tong;
            phieunhap.SoLuongNhap = soluongnhap;
            justshop.PhieuNhapHangs.Add(phieunhap);
            justshop.SaveChanges();
        }
Ejemplo n.º 2
0
        public bool delete(int id)
        {
            PhieuNhapHang a = (from c in justshop.PhieuNhapHangs where c.MaPhieuNhap == id select c).SingleOrDefault();

            if (a == null)
            {
                return(false);
            }
            justshop.PhieuNhapHangs.Remove(a);
            justshop.SaveChanges();
            return(true);
        }
Ejemplo n.º 3
0
        public bool update(int maphieunhap, int soluongnhap, float tong)
        {
            PhieuNhapHang phieunhap = (from c in justshop.PhieuNhapHangs where c.MaPhieuNhap == maphieunhap select c).SingleOrDefault();

            if (phieunhap == null)
            {
                return(false);
            }
            phieunhap.SoLuongNhap = soluongnhap;
            phieunhap.TongTien    = tong;
            justshop.SaveChanges();
            return(true);
        }