public IActionResult Tables(string s, string kw, int p = 1, int t = 25) { // Şubede tanımlı masa adedi var tableCount = _tableService.GetTotalTablesCountFiltered(_currentUser.BranchId, kw); // Şubede tanımlı masalar var tables = _tableService.GetTablesOfBranchFiltered(_currentUser.BranchId, kw, s, p, t) .Select(i => new TableDto { Id = i.Id.ToString().Encrypt(), Name = i.Name, Code = i.Code, IsClosed = i.IsClosed }).ToList(); var pagination = new PaginationModel() { Count = tableCount, Page = p, Top = t, SortBy = s, Keyword = kw }; var model = new TablesViewModel { Tables = tables, Pagination = pagination, CurrentUserRoles = _currentUserRoles, CurrentUser = _currentUser, CurrentFirmLogo = _currentFirm.LogoPath }; return(View(model)); }
public Tables(string accessToken, string username) { this.accessToken = accessToken; this.username = username; viewModel = new TablesViewModel(accessToken, username); InitializeComponent(); this.DataContext = viewModel; this.Orders.Navigate += MyControl_OnNavigateParentReady; }
public ActionResult Index() { TablesViewModel tables = new TablesViewModel(); tables.Independent = _context.Independent.ToList(); tables.Responses = _context.Responses.ToList(); tables.MathFunctions = _context.MathFunction.ToList(); return(View(tables)); }
public async Task <ActionResult> Index() { var tables = await _tableRepository.GetAllAsync(); var viewModel = new TablesViewModel() { Tables = tables, }; return(View(viewModel)); }
public async Task <ActionResult> Display() { var tables = await _tableService.GetAllAsync(); var viewModel = new TablesViewModel() { Tables = tables, }; return(View(viewModel)); }
public void init() { m_cardOrderEngine = new CardOrderEngine(); m_cardOrderEngine.setDbTableInitialization("all"); // cardnet db init + rewardo db init m_cardOrderEngine.getCardnetDAL().retrieveRequests("all"); m_cardOrderEngine.getCardnetDAL().retrieveAnswers("all"); m_cardOrderEngine.getCardnetDAL().retrievePartners(); m_cardOrderEngine.getCardnetDAL().retrieveConstantUniversal(); m_tablesViewModel = new TablesViewModel(); fillTableViewModel(); }
public ActionResult ReserveTable(TablesViewModel tablesView) { if (tablesView.SelectedDate == null) { ModelState.AddModelError("", "Date cannot be null"); return(View(GetReserveTablesViewData())); } ReservationsManager.CreateReservation(tablesView); return(View(GetReserveTablesViewData())); }
// GET: Tables public ActionResult Index() { ShipperBO sbo = new ShipperBO(); CategoryBO cbo = new CategoryBO(); var shippers = sbo.GetList(); var categories = cbo.GetList(); TablesViewModel tb = new TablesViewModel(); tb.Shippers = shippers; tb.Categories = categories; return(View(tb)); }
public void init() { m_cardOrderEngine = new CardOrderEngine(); var pomList = new List <string>() { "PosAcceptanceRequests", "PosAcceptanceAnswers", "CardOrderRequests", "CardOrderAnswers", "CreditOrderRequests", "CreditOrderAnswers", "CardStatusUpdateRequests", "CardStatusUpdateAnswers", "CardTransferRequests", "CardTransferAnswers", "partners", "constantUniversals", "constantPartners" }; m_cardOrderEngine.setDbTableInitialization("all", pomList); m_tablesViewModel = new TablesViewModel(); fillTableViewModel(m_tablesViewModel); }
public IActionResult AllInvoices() { var invoices = _invoiceRepo.GetAll(); var model = new TablesViewModel() { MaxNumAccounts = MaxNumOfAccounts(invoices), Invoices = invoices, AccountsLists = new List <List <string> >(), CurrentAccountList = new List <string>(), Index = 0 }; return(View(model)); }
public IActionResult UnprocessedInvoices() { var invoices = _invoiceRepo.GetAll() .Where(x => x.Status == InvoiceStatus.Unprocessed); var model = new TablesViewModel() { MaxNumAccounts = MaxNumOfAccounts(invoices), Invoices = invoices, AccountsLists = new List <List <string> >(), CurrentAccountList = new List <string>(), Index = 0 }; return(View(model)); }
public TableViewModel CreateTableViewModel(string title, IList <ClassResultRow> tableRows) { TablesViewModel model = new TablesViewModel(); var tableViewModel = new TableViewModel(); tableViewModel.Title = title; tableViewModel.TableHeaders.AddRange(new[] { "Onderwerp", "Leerdoel", "Aantal opgaves", "Goed", "Fout", "% Goed" }); foreach (ClassResultRow row in tableRows) { var tableRowViewModel = CreateTableRow(row); tableViewModel.Rows.Add(tableRowViewModel); } var sumRow = CreateSumRow(tableRows); tableViewModel.Rows.Add(sumRow); model.Tables.Add(tableViewModel); return(tableViewModel); }
public static void CreateReservation(TablesViewModel tablesViewModel) { using (DatabaseModel model = new DatabaseModel()) { var currentUsername = HttpContext.Current.User.Identity.Name; var user = (CustomMembershipUser)Membership.GetUser(currentUsername, false); // add new reservation model.Reservations.Add(new Reservation { UserID = user.UserId, PoolTableID = tablesViewModel.SelectedTableID, ReservationTime = tablesViewModel.SelectedDate }); // update table occupation var selectedtable = model.PoolTables.FirstOrDefault(x => x.PoolTableID == tablesViewModel.SelectedTableID); if (selectedtable != null) { selectedtable.IsOccupied = true; } model.SaveChanges(); } }
public ActionResult Index() { try { DateTime now = new DateTime(2015, 03, 24, 11, 30, 00, DateTimeKind.Utc); var twoWeeksAgo = now.AddDays(-14); IList <ClassResultRow> todayRows = _dataService.GetClassResult(now); IList <ClassResultRow> twoWeeksAgoRows = _dataService.GetClassResult(twoWeeksAgo); var todayTable = _tableViewModelMapper.CreateTableViewModel($"Resulten van vandaag {now.ToLocalTime()}", todayRows); var toWeeksAgoTable = _tableViewModelMapper.CreateTableViewModel($"Resulten van {twoWeeksAgo.ToLocalTime()}", twoWeeksAgoRows); var model = new TablesViewModel(todayTable, toWeeksAgoTable); return(View("Tables", model)); } catch (Exception) { // Todo: Log Error return(View("Error")); } }
/// <summary> /// Retrieves TablesViewModel /// </summary> /// <returns></returns> public /*List<Tuple<string,string>*/ void retrieveOperationTypes(TablesViewModel tblViewModel) { // retrieve constant unversal data from db into @m_constantUniversal var constantUniversal = m_cardnetDB.C___CONSTANT_UNIVERSAL.Where(o => o.constant_name == "operation_type").OrderByDescending(o => o.insert_date).ToList(); var pom1 = new List <Tuple <string, string> >(); var pomD = new Dictionary <string, Dictionary <string, string> >(); int todaysWaitings; int allWaitings; int todaysProcessed; DateTime?lastProcessedDateTime; //= new DateTime(); foreach (var item in constantUniversal) { todaysWaitings = 0; allWaitings = 0; todaysProcessed = 0; lastProcessedDateTime = new DateTime(); var pomInnerDict = new Dictionary <string, string>(); pom1.Add(new Tuple <string, string>(item.constant_description, item.additional_value1)); if (item.constant_description == "POS ACCEPTANCE") { // get todays waitings todaysWaitings = (from i in m_req001 where i.CreationDateTime >= DateTime.Today select i).Count() - (from j in m_ans001 where j.InsertDateTime >= DateTime.Today select j).Count(); allWaitings = m_req001.Count() - m_ans001.Count(); todaysProcessed = (from j in m_ans001 where j.InsertDateTime >= DateTime.Today select j).Count(); lastProcessedDateTime = m_ans001.Max(x => x.InsertDateTime); } else if (item.constant_description == "CARD ORDER") { todaysWaitings = (from j in m_ans002 where j.InsertDateTime >= DateTime.Today && j.Additional_column1 == null && j.RequestStatus == 4 select j).Count(); allWaitings = (from j in m_ans002 where j.Additional_column1 == null && j.RequestStatus == 4 select j).Count(); todaysProcessed = (from j in m_ans002 where j.InsertDateTime >= DateTime.Today && j.RequestStatus == 1 select j).Count(); lastProcessedDateTime = m_ans002.Max(x => x.InsertDateTime); } else if (item.constant_description == "CREDIT ORDER") { todaysWaitings = (from i in m_req003 where i.CreationDateTime >= DateTime.Today select i).Count() - (from j in m_ans003 where j.ChangeTime >= DateTime.Today select j).Count(); allWaitings = m_req003.Count() - m_ans003.Count(); todaysProcessed = (from j in m_ans003 where j.ChangeTime >= DateTime.Today select j).Count(); lastProcessedDateTime = m_ans003.Max(x => x.ChangeTime); } else if (item.constant_description == "CARD STATUS UPDATE") { todaysWaitings = (from i in m_req004 where i.CreationDateTime >= DateTime.Today select i).Count() - (from j in m_ans004 where j.ChangeTime >= DateTime.Today select j).Count(); allWaitings = m_req004.Count() - m_ans004.Count(); todaysProcessed = (from j in m_ans004 where j.ChangeTime >= DateTime.Today select j).Count(); lastProcessedDateTime = m_ans004.Max(x => x.ChangeTime); } else if (item.constant_description == "CARD TRANSFER") { // TENTO REQUEST MOZE MAT VIACERO ODPOVEDI, TAKZE VYPOCET JE TROCHU KOMPLIKOVANEJSI var requests = 0; var answers = 0; var todayRequests = 0; var todayAnswers = 0; foreach (var p in m_partners) { var pomTodayRequestsCount = m_req008.Where(r => r.PartnerId == p.ID && r.CreationDateTime >= DateTime.Today).Select(r => r.RequestId).Count(); var pomTodayAnswersCount = m_ans008.Where(a => a.PartnerId == p.ID && a.ChangeTime >= DateTime.Today).Select(a => a.RequestId).Distinct().Count(); var pomRequestsCount = m_req008.Where(r => r.PartnerId == p.ID).Select(r => r.RequestId).Count(); var pomAnswersCount = m_ans008.Where(a => a.PartnerId == p.ID).Select(a => a.RequestId).Distinct().Count(); requests += pomRequestsCount; answers += pomAnswersCount; todayRequests += pomTodayRequestsCount; todayAnswers += pomTodayAnswersCount; } todaysWaitings = todayRequests - todayAnswers; //(from i in m_req008 where i.CreationDateTime >= DateTime.Today select i).Count() - (from j in m_ans008 where j.ChangeTime >= DateTime.Today select j).Count(); allWaitings = requests - answers; //m_req008.Count() - m_ans008.Count(); todaysProcessed = (from j in m_ans008 where j.ChangeTime >= DateTime.Today select j).Count(); lastProcessedDateTime = m_ans008.Max(x => x.ChangeTime); } pomInnerDict["TODAYSWAITING"] = todaysWaitings.ToString(); pomInnerDict["ALLWAITING"] = allWaitings.ToString(); pomInnerDict["TODAYSPROCESSED"] = todaysProcessed.ToString(); pomInnerDict["LASTPROCESSEDDATETIME"] = lastProcessedDateTime.ToString() == "" ? "null" : lastProcessedDateTime.ToString(); if (pomInnerDict.Any()) { pomD.Add(item.constant_description, new Dictionary <string, string>()); pomD[item.constant_description] = pomInnerDict; } } tblViewModel.CardnetTables = pom1; tblViewModel.CardnetTableColumns = pomD; }
public void fillTableViewModel(TablesViewModel tablesViewModel) { m_cardOrderEngine.getCardnetDAL().retrieveOperationTypes(tablesViewModel); }
public TablesPage() { InitializeComponent(); BindingContext = viewModel = new TablesViewModel(App.Database); }