public ActionResult AccountList() { GetAccounts g = new GetAccounts(); List <Account> accounts = g.A().OrderBy(x => x.AccountNumber).ToList(); return(View(accounts)); }
public ActionResult Create([Bind(Include = "Id,Account,ProductsId,MakeAnOffer,OfferBitPrice")] SetBid SetBid) { if (ModelState.IsValid) { var product = db.Products.Where(p => p.Id == SetBid.ProductsId).FirstOrDefault(); product.LastBidPrice = SetBid.OfferBitPrice; db.Entry(product).State = EntityState.Modified; db.SaveChanges(); var userid = User.Identity.GetUserId(); SetBid.ApplicationUserId = userid; db.SetBids.Add(SetBid); db.SaveChanges(); return(View("SuccessOffer")); } var results = GetAccounts.Get(); var ktima = GetCurrentInfo.Get(); ViewBag.ktimaInfo = ktima; ViewBag.selectedid = SetBid.ProductsId; ViewBag.AccountNo = new SelectList(results, "AccountId", "AccountId", SetBid.Account); ViewBag.ProductsId = new SelectList(db.Products, "Id", "ItemName", SetBid.ProductsId); return(View(SetBid)); }
public ActionResult TransactionEdit(IFormCollection forms) { string personid = forms["personid"]; string firstday = forms["firstday"]; string lastday = forms["lastday"]; var collection = context.db.GetCollection <Transaction>("Transactions"); GetAccounts g = new GetAccounts(); var date = g.StrToDate(forms["TransactionDate"]); var filter = Builders <Transaction> .Filter.Eq("_id", ObjectId.Parse(forms["Id"])); var update = Builders <Transaction> .Update .Set("TransactionID", Convert.ToInt32(forms["TransactionID"])) .Set("TransactionDescription", forms["TransactionDescription"]) .Set("TransactionDate", date) .Set("AccountNumber1", Convert.ToInt32(forms["AccountNumber1"])) .Set("Account1Amount", Convert.ToDecimal(forms["Account1Amount"])); var result = collection.UpdateOne(filter, update); Transaction trans = collection.Find(x => x.Id == ObjectId.Parse(forms["Id"])).FirstOrDefault(); ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; return(RedirectToAction("TransactionList", new { personid = ViewBag.personid, firstDay = ViewBag.firstDay, lastDay = ViewBag.lastDay })); }
public Task <List <AccountVm> > Handle(GetAccounts request, CancellationToken cancellationToken) { return(_context.Accounts .Include(a => a.Skills) .ToListAsync(cancellationToken) .ContinueWith(t => t.Result.Select(a => _mapper.Map <AccountVm>(a)).ToList())); }
// GET: public ActionResult TransactionCreate(string personid, string firstday, string lastday) { GetAccounts g = new GetAccounts(); SelectList s = g.AccountsSelectList(4610); ViewBag.accounts = s; ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; return(View()); }
// GET: public ActionResult AccountCreate() { GetAccounts g = new GetAccounts(); SelectList s = g.AccountPersonSelectList("Mike"); ViewBag.accountpersons = s; SelectList s2 = g.AccountTypesSelectList("Expenses"); ViewBag.accounttypes = s2; return(View()); }
public ActionResult Index() { int year = DateTime.Today.Year - 1; ViewBag.firstDay = "01/01/" + year.ToString(); ViewBag.lastDay = "12/31/" + year.ToString(); GetAccounts g = new GetAccounts(); SelectList s = g.AccountPersonSelectList("Allen"); ViewBag.accountpersons = s; return(View()); }
public async Task <IEnumerable <AccountDto> > Handle(GetAccounts request, CancellationToken cancellationToken) { var result = await _accountRepository.GetAll(); var dtos = result.Select(x => new AccountDto { Id = x.Id, Name = x.UserName }); return(dtos); }
// GET: public ActionResult TransactionEdit(string id, string personid, string firstday, string lastday) { Transaction trans = context.db.GetCollection <Transaction>("Transactions") .Find(x => x.Id == ObjectId.Parse(id)).FirstOrDefault(); GetAccounts g = new GetAccounts(); SelectList s = g.AccountsSelectList(trans.AccountNumber1); ViewBag.accounts = s; ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; return(View(trans)); }
public GetAccountsResponse Get(GetAccounts request) { using (var transaction = Db.OpenTransaction()) { var data = Db.Select <AccountData>(); var count = Db.Count <AccountData>(); var accounts = data.Select(x => x.ConvertTo <AccountModel>()).ToArray(); return(new GetAccountsResponse { Accounts = accounts, Total = count }); } }
// GET: public ActionResult AccountEdit(string id) { var collection = context.db.GetCollection <Account>("Accounts"); Account account = collection.Find(x => x.Id == ObjectId.Parse(id)).FirstOrDefault(); GetAccounts g = new GetAccounts(); SelectList s = g.AccountPersonSelectList(account.AccountPerson.AccountPerson1); ViewBag.accountpersons = s; SelectList s2 = g.AccountTypesSelectList(account.AccountSubType.AccountType.AccountType1); ViewBag.accounttypes = s2; return(View(account)); }
public IEnumerable <AccountSummary> Handle(GetAccounts message) { return(_session.Query <AccountSummaryView>() .Select( a => new AccountSummary { AccountId = a.AccountId, Balance = a.Balance, ClientId = a.ClientId, Number = a.Number, TransactionsCount = a.TransactionsCount } ) .ToList()); }
public async Task <IEnumerable <AccountSummary> > Handle(GetAccounts message, CancellationToken cancellationToken = default(CancellationToken)) { var result = await _session.Query <AccountSummaryView>() .Select( a => new AccountSummary { AccountId = a.AccountId, Balance = a.Balance, ClientId = a.ClientId, Number = a.Number, TransactionsCount = a.TransactionsCount } ).Where(p => p.ClientId == message.ClientId) .ToListAsync(cancellationToken); return(result); }
public override int GetHashCode() { int hash = 1; if (getAccounts_ != null) { hash ^= GetAccounts.GetHashCode(); } if (saveAccounts_ != null) { hash ^= SaveAccounts.GetHashCode(); } if (deleteAccounts_ != null) { hash ^= DeleteAccounts.GetHashCode(); } if (getEmployees_ != null) { hash ^= GetEmployees.GetHashCode(); } if (saveEmployees_ != null) { hash ^= SaveEmployees.GetHashCode(); } if (deleteEmployees_ != null) { hash ^= DeleteEmployees.GetHashCode(); } if (getJobs_ != null) { hash ^= GetJobs.GetHashCode(); } if (saveJobs_ != null) { hash ^= SaveJobs.GetHashCode(); } if (deleteJobs_ != null) { hash ^= DeleteJobs.GetHashCode(); } return(hash); }
// GET: SetBids/Create public ActionResult Create(int id) { ViewBag.ProductsId = new SelectList(db.Products.Where(o => o.Id == id), "Id", "ItemName", id); ViewBag.Product = db.Products.Where(o => o.Id == id).FirstOrDefault(); var results = GetAccounts.Get(); List <AccountsResponse> accountid = new List <AccountsResponse>(); var ktima = GetCurrentInfo.Get(); ViewBag.ktimaInfo = ktima; ViewBag.selectedid = id; foreach (var item in results) { AccountsResponse accid = new AccountsResponse(); accid.AccountId = item.AccountId; accountid.Add(accid); } ViewBag.AccountNo = new SelectList(accountid, "AccountId", "AccountId"); return(View()); }
public ActionResult TransactionList(IFormCollection forms, int?page) { string personid = forms["personid"]; string firstday = forms["firstday"]; string lastday = forms["lastday"]; GetAccounts g = new GetAccounts(); List <TransactionsWithAccounts> returnList = g.TA(firstday, lastday, personid); ViewBag.CurrentSort = "TransactionDate"; ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; /* int pageSize = 20; * int pageNumber = (page ?? 1); */ return(View(returnList)); }
public void MergeFrom(MainController other) { if (other == null) { return; } if (other.getAccounts_ != null) { if (getAccounts_ == null) { getAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } GetAccounts.MergeFrom(other.GetAccounts); } if (other.saveAccounts_ != null) { if (saveAccounts_ == null) { saveAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } SaveAccounts.MergeFrom(other.SaveAccounts); } if (other.deleteAccounts_ != null) { if (deleteAccounts_ == null) { deleteAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } DeleteAccounts.MergeFrom(other.DeleteAccounts); } if (other.getEmployees_ != null) { if (getEmployees_ == null) { getEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } GetEmployees.MergeFrom(other.GetEmployees); } if (other.saveEmployees_ != null) { if (saveEmployees_ == null) { saveEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } SaveEmployees.MergeFrom(other.SaveEmployees); } if (other.deleteEmployees_ != null) { if (deleteEmployees_ == null) { deleteEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } DeleteEmployees.MergeFrom(other.DeleteEmployees); } if (other.getJobs_ != null) { if (getJobs_ == null) { getJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } GetJobs.MergeFrom(other.GetJobs); } if (other.saveJobs_ != null) { if (saveJobs_ == null) { saveJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } SaveJobs.MergeFrom(other.SaveJobs); } if (other.deleteJobs_ != null) { if (deleteJobs_ == null) { deleteJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction(); } DeleteJobs.MergeFrom(other.DeleteJobs); } }
public Task <IEnumerable <AccountSummary> > Get([FromQuery] GetAccounts query) { return(_queryBus.Send(query)); }
public ActionResult TransactionList(int?page, string personid, string firstday, string lastday, string sortOrder, bool?ChangeSort) { // DateTime fromDate = Convert.ToDateTime(firstday); // DateTime toDate = Convert.ToDateTime(lastday); GetAccounts g = new GetAccounts(); List <TransactionsWithAccounts> returnList = g.TA(firstday, lastday, personid); switch (sortOrder) { case "TransactionDate_desc": if (ChangeSort ?? false) { returnList.Sort((x, y) => DateTime.Compare(x.TransactionDate, y.TransactionDate)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "TransactionDate"; } else { returnList.Sort((x, y) => - 1 * DateTime.Compare(x.TransactionDate, y.TransactionDate)); ViewBag.DateSortParm = "TransactionDate_desc"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "TransactionDate_desc"; } break; case "TransactionDate": if (ChangeSort ?? false) { returnList.Sort((x, y) => - 1 * DateTime.Compare(x.TransactionDate, y.TransactionDate)); ViewBag.DateSortParm = "TransactionDate_desc"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "TransactionDate_desc"; } else { returnList.Sort((x, y) => DateTime.Compare(x.TransactionDate, y.TransactionDate)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "TransactionDate"; } break; case "AcctNumber": if (ChangeSort ?? false) { returnList.Sort((x, y) => - 1 * x.AccountNumber1.CompareTo(y.AccountNumber1)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber_desc"; ViewBag.CurrentSort = "AcctNumber_desc"; } else { returnList.Sort((x, y) => x.AccountNumber1.CompareTo(y.AccountNumber1)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "AcctNumber"; } break; case "AcctNumber_desc": if (ChangeSort ?? false) { returnList.Sort((x, y) => x.AccountNumber1.CompareTo(y.AccountNumber1)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber"; ViewBag.CurrentSort = "AcctNumber"; } else { returnList.Sort((x, y) => - 1 * x.AccountNumber1.CompareTo(y.AccountNumber1)); ViewBag.DateSortParm = "TransactionDate"; ViewBag.AcctSortParm = "AcctNumber_desc"; ViewBag.CurrentSort = "AcctNumber_desc"; } break; default: break; } /* int pageSize = 20; * int pageNumber = (page ?? 1); */ ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; return(View(returnList)); }
public ActionResult ProfitAndLoss(IFormCollection forms) { string personid = forms["PersonID"]; string firstday = forms["firstDay"]; string lastday = forms["lastDay"]; ViewBag.firstday = firstday; ViewBag.lastday = lastday; ViewBag.personid = personid; List <Transaction> transactions = context.db.GetCollection <Transaction>("Transactions") .AsQueryable().ToList(); List <Transaction> filteredtransactions = transactions.AsQueryable() .Where(x => x.TransactionDate >= Convert.ToDateTime(firstday)) .Where(x => x.TransactionDate <= Convert.ToDateTime(lastday)).ToList(); GetAccounts g = new GetAccounts(); List <Account> accounts = g.A().Where(c => c.AccountPerson.AccountPerson1 == personid) .Where(x => x.Active == true).ToList(); List <FilteredTransactions> ta = filteredtransactions .Join(accounts, t => t.AccountNumber1, a => a.AccountNumber, (t, a) => new FilteredTransactions { AccountNumber = t.AccountNumber1, AccountName = a.AccountName, AccountSubType = a.AccountSubType.AccountSubType1, SortOrder = a.AccountSubType.SortOrder, AccountType = a.AccountSubType.AccountType.AccountType1, Total = t.Account1Amount, Count = 1, AccountPerson = a.AccountPerson.AccountPerson1 }).ToList(); List <FilteredTransactions> AGroup = ta .GroupBy(s => s.AccountNumber) .Select(group => new FilteredTransactions { AccountNumber = group.First().AccountNumber, AccountName = group.First().AccountName, AccountSubType = group.First().AccountSubType, SortOrder = group.First().SortOrder, AccountType = group.First().AccountType, Total = group.Sum(s => s.Total), Count = group.Count(), AccountPerson = group.First().AccountPerson }).ToList(); List <FilteredTransactions> ASTGroup = ta .GroupBy(s => s.AccountSubType) .Select(group => new FilteredTransactions { AccountNumber = null, AccountName = "Total", AccountSubType = group.First().AccountSubType, SortOrder = group.First().SortOrder, AccountType = group.First().AccountType, Total = group.Sum(s => s.Total), Count = group.Count(), AccountPerson = group.First().AccountPerson }).ToList(); List <FilteredTransactions> ATGroup = ta .GroupBy(s => s.AccountType) .Select(group => new FilteredTransactions { AccountNumber = null, AccountName = "", AccountSubType = "Total", SortOrder = 999, AccountType = group.First().AccountType, Total = group.Sum(s => s.Total), Count = group.Count(), AccountPerson = group.First().AccountPerson }).ToList(); List <FilteredTransactions> listFinal = AGroup.Union(ASTGroup).Union(ATGroup) .OrderByDescending(x => x.AccountType) .ThenBy(x => x.SortOrder).ToList(); return(View(listFinal)); }