示例#1
0
        public void addCT(int maphieunhap, int maloai, int masp, int soluong, float gianhap)
        {
            CTPhieunhap a = new CTPhieunhap();

            a.MaPhieuNhap = maphieunhap;
            a.MaLoai      = maloai;
            a.MaSp        = masp;
            a.Soluong     = soluong;
            a.GiaNhap     = gianhap;
            justshop.CTPhieunhaps.Add(a);
            justshop.SaveChanges();
        }
示例#2
0
        public bool delete(int id)
        {
            CTPhieunhap ct = (from c in justshop.CTPhieunhaps where c.MaCTPhieuNhap == id select c).SingleOrDefault();

            if (ct == null)
            {
                return(false);
            }
            justshop.CTPhieunhaps.Remove(ct);
            justshop.SaveChanges();
            return(true);
        }
示例#3
0
        public bool update(int id, int maphieunhap, int maloai, int masp, int soluong, float gianhap)
        {
            CTPhieunhap a = (from c in justshop.CTPhieunhaps where c.MaCTPhieuNhap == id select c).SingleOrDefault();

            if (a == null)
            {
                return(false);
            }
            a.MaLoai      = maloai;
            a.MaPhieuNhap = maphieunhap;
            a.MaSp        = masp;
            a.Soluong     = soluong;
            a.GiaNhap     = gianhap;
            justshop.SaveChanges();
            return(true);
        }
示例#4
0
        public CTPhieunhap search(int id)
        {
            CTPhieunhap a = (from c in justshop.CTPhieunhaps where c.MaCTPhieuNhap == id select c).SingleOrDefault();

            return(a);
        }