public void createTransactionOverAccount(string accountid, string userid, string subcategoryid, string categoryid, string description, string amount, int duemonth, int duedate, int paiddate, int paidmonth, int paidyear, paymentrecurrence recurrence) { ApplicationService.financial fin = GetuserFinancial(GetUserProfile(userid).profileid, userid); DateTime finstartdate = new DateTime(DateTime.Now.Year, fin.accmonthstart, fin.accdatestart); DateTime finenddate = new DateTime(DateTime.Now.Year, fin.accmonthend, fin.accdateend); switch (recurrence) { case paymentrecurrence.daily: foreach (DateTime day in EachDay(finstartdate, finenddate, 1)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.week: foreach (DateTime day in EachDay(finstartdate, finenddate, 7)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.biweek: foreach (DateTime day in EachDay(finstartdate, finenddate, 14)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.halfmonth: foreach (DateTime day in EachDay(finstartdate, finenddate, 15)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.month: foreach (DateTime day in EachDay(finstartdate, finenddate, 30)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.qyear: foreach (DateTime day in EachDay(finstartdate, finenddate, 91)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.halfyear: foreach (DateTime day in EachDay(finstartdate, finenddate, 182)) { appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), day.Month, day.Day, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); } break; case paymentrecurrence.year: appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), duemonth, duedate, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); break; case paymentrecurrence.none: appclient.Create_transaction(userid, accountid, "", "", description, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), duemonth, duedate, paiddate, paidmonth, paidyear, "", subcategoryid, categoryid, Convert.ToDecimal(0.00), Convert.ToDecimal(amount), ""); break; default: break; } }
public ApplicationService.financial GetuserFinancial(string profileid, string ownerid) { ApplicationService.financial finance = appclient.Getfinancial(profileid, ownerid); return(finance); }