public void ProcessMailForExpenses(string subjectName) { List <MailMessage> claims = mailHelper.getStringMessages(subjectName); foreach (MailMessage claim in claims) { //store the request.... RequestDAO request = new RequestDAO(); if (request.shouldProcess(claim.id)) { Request req = request.createRequestOrGetRequest(claim.from, claim.body, DateTime.Now, claim.id); //call the rest service. XmlDocument xdoc = RestHelper.callRestService(restEndPoint, claim.body); ExpenseDTO expenseDTO = Deserialiser.deserialiseContent <ExpenseDTO>(xdoc); ExpenseDAO expenseDAO = new ExpenseDAO(); Expense expenseToValidate = expenseDAO.CreateExpense(expenseDTO, req); ExpenseValidator validator = new ExpenseValidator(expenseToValidate); mailHelper.sendMessage(claim.from, validator.getMessage(), claim.id, string.Format("response to claim dated {0}", claim.date)); //deserialise the content //validate the request //store - valid request or failure and respond to user } } }
public List <Expense> RetrieveDataByEmail(string email) { ExpenseDAO dao = new ExpenseDAO(); List <Expense> result = dao.SearchByEmail(email); return(result); }
public int DeleteByRow(long sid) { ExpenseDAO dao = new ExpenseDAO(); int result = dao.DeletebyRow(sid); return(result); }
public List <Expense> selectGraphData(string date, string price) { ExpenseDAO dao = new ExpenseDAO(); List <Expense> result = dao.SelectGraphData(date, price); return(result); }
public int UpdateExpense() { ExpenseDAO dao = new ExpenseDAO(); int result = dao.Update(this); return(result); }
public int AddExpense(string email) { ExpenseDAO dao = new ExpenseDAO(); int result = dao.Insert(this, email); return(result); }
public List <Expense> FilterDate(string startDate, string endDate) { //DateTime startDate = ExpenseDAO dao = new ExpenseDAO(); List <Expense> result = dao.FilterByDate(startDate, endDate); return(result); }
public static ExpenseDAO mapToExpenseDAO(ExpenseDTO b) { ExpenseDAO a = new ExpenseDAO(); a.Cost = b.Cost; a.Id = b.Id; a.Name = b.Name; return(a); }
public static Expense MapToExpense(ExpenseDAO expense) { var c = new Expense(); c.Id = expense.Id; c.Name = expense.Name; c.Cost = expense.Cost; return(c); }
public List <Expense> GetAllExpense(string email) { ExpenseDAO dao = new ExpenseDAO(); return(dao.SelectAll(email)); }
public bool AddJobExpense(JobDAO j, ExpenseDAO ex) { return(ef.AddJobExpense(JobMapper.MapToJob(j), ExpenseMapper.MapToExpense(ex))); }
public bool DeleteExpense(ExpenseDAO ex) { return(ef.DeleteExpense(ExpenseMapper.MapToExpense(ex))); }
public bool UpdateExpense(ExpenseDAO ex) { return(ef.UpdateExpense(ExpenseMapper.MapToExpense(ex))); }
public bool AddExpense(ExpenseDAO ex) { return(ef.AddExpense(ExpenseMapper.MapToExpense(ex))); }
public ExpenseBUS() { sDao = new ExpenseDAO(); }