예제 #1
0
        public bool deleteCTPhieuNhap(CTPHIEUNHAP item)
        {
            bool      ck    = false;
            DoChoiDao dcDao = new DoChoiDao();

            ck = dcDao.addSLDC(item.MADC, -1 * item.SL);
            ck = ck && ctDao.deleteCTPhieuNhap(item.MAPHIEU);
            return(ck);
        }
예제 #2
0
        public bool editCTPhieuNhap(CTPHIEUNHAP item)
        {
            bool ck = false;

            int       delta = item.SL - ctDao.CTPHIEUNHAPbyID(item.MAPHIEU, item.MADC).SL;
            DoChoiDao dcDao = new DoChoiDao();

            ck = dcDao.addSLDC(item.MADC, delta);
            ck = ck && ctDao.editCTPhieuNhap(item);
            return(ck);
        }
예제 #3
0
        public int AddPhieuNhap(PHIEUNHAP pn, List <CTPHIEUNHAP> listCt)
        {
            int c = 0;

            c = phDao.AddPhieuNhap(pn);
            CTPhieuNhapDao ctDao = new CTPhieuNhapDao();
            DoChoiDao      dcDao = new DoChoiDao();

            foreach (CTPHIEUNHAP it in listCt)
            {
                it.MAPHIEU = pn.MAPHIEU;
                c         += ctDao.AddCTPhieuNhap(it);
                c         += dcDao.addSLDC(it.MADC, it.SL) ? 1 : 0;
            }
            return(c);
        }