Example #1
0
        public int AddReceiptDocType(ReceiptDocType receiptDocType)
        {
            _context.ReceiptDocTypes.Add(receiptDocType);
            _context.SaveChanges();

            return(receiptDocType.Id);
        }
Example #2
0
        public bool UpdateReceiptDocType(int id, ReceiptDocType receiptDocType)
        {
            ReceiptDocType existreceipt = GetReceiptDocTypeById(id);

            if (existreceipt == null)
            {
                return(false);
            }
            existreceipt.Name = receiptDocType.Name;
            _context.Update(existreceipt);
            _context.SaveChanges();
            return(true);
        }