public int AddReceiptDocType(ReceiptDocType receiptDocType) { _context.ReceiptDocTypes.Add(receiptDocType); _context.SaveChanges(); return(receiptDocType.Id); }
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); }