public void MarkBillAsPaid(int billId) { DbAccess.Entities.Bill dbbill = this.repo.GetById(billId); dbbill.Paid = true; repo.Update(dbbill); repo.Save(); }
public IBill DbBillToIBill(DbAccess.Entities.Bill entity) { IBill bill = _factory.BillFactory.NewBill(entity.BillId, entity.RecipientId, entity.BillTypeDictId, entity.Description, entity.DueAmount, entity.DueDate, entity.Periodical, entity.Period, entity.Paid); bill.Recipient = _factory.RecipientFactory.NewRecipient(entity.Recipient.RecipientId, entity.Recipient.CompanyName, entity.Recipient.Address, entity.Recipient.Account, entity.Recipient.CustomerServiceUrl, entity.Recipient.Active); bill.BillType = _factory.BillFactory.NewBillType(entity.BillTypeDict.BillTypeDictId, entity.BillTypeDict.Name); return(bill); }
public void UpdateBill(IBill bill) { DbAccess.Entities.Bill dbbill = this.repo.GetById(bill.BillId); dbbill.Description = bill.Description; dbbill.DueAmount = bill.DueAmount; dbbill.DueDate = bill.DueDate; dbbill.Periodical = bill.Periodical; dbbill.BillTypeDictId = bill.BillTypeId; dbbill.RecipientId = bill.RecipientId; dbbill.Paid = bill.Paid; repo.Update(dbbill); repo.Save(); }
public void CreateBill(IBill bill) { DbAccess.Entities.Bill dbbill; if (bill.Period > 0) { dbbill = new DbAccess.Entities.Bill() { BillId = bill.BillId, Description = bill.Description, DueAmount = bill.DueAmount, DueDate = bill.DueDate, Periodical = true, BillTypeDictId = bill.BillTypeId, RecipientId = bill.RecipientId, Period = bill.Period, Paid = false }; } else { dbbill = new DbAccess.Entities.Bill() { BillId = bill.BillId, Description = bill.Description, DueAmount = bill.DueAmount, DueDate = bill.DueDate, Periodical = false, BillTypeDictId = bill.BillTypeId, RecipientId = bill.RecipientId, Period = 0, Paid = false }; } repo.Insert(dbbill); repo.Save(); }