public ActionResult Customers() { var customers = new List <Customer> { new Customer { Name = "Vansi krishna", id = 1001 }, new Customer { Name = "Razzak", id = 1002 }, new Customer { Name = "Yogendra", id = 1003 }, new Customer { Name = "Rajendar", id = 1004 }, new Customer { Name = "Andrew", id = 1005 } }; var viewModel = new AllCustomers { Customers = customers }; return(View(viewModel)); }
public void Search(string searched) { searched = searched.ToLower(); List <Customers> result = AllCustomers .Where(x => x.CustomerId.ToLower().Contains(searched)).ToList(); CustomerResults = new ObservableCollection <Customers>(result); }
public ActionResult Index(AllCustomers query) { FillSelectLists(query); query.OrgId = CurrentUser.OrganizationId; var list = query.Execute(); return(View(list)); }
public void AllCustomersCase() { var results = new AllCustomers(_db) { HasPhone = false }.Execute(); Assert.IsTrue(results.All(row => string.IsNullOrEmpty(row.Phone))); }
public Customer(string firstName, string lastName, string email, string password) { FirstName = firstName; LastName = lastName; Email = email; CustomerId = customerId; customerId += 1; Password = password; AllCustomers.Add(this); }
public OrderFormViewModel() { Order = StateService.CurrentOrder; AllCustomers = ComboBoxService.GetOptions(ComboBoxTargets.Customers); CurrentCustomer = AllCustomers.FirstOrDefault(x => x.ID == Order.CustomerID); AllEmployees = ComboBoxService.GetOptions(ComboBoxTargets.Employees); CurrentEmployee = AllEmployees.FirstOrDefault(x => x.ID == Order.EmployeeID); AllProducts = ComboBoxService.GetOptions(ComboBoxTargets.Products); CurrentProduct = AllProducts.FirstOrDefault(x => x.ID == Order.ProductID); }
// GET: Customer public ActionResult Index() { //will return all customers as a list. var vm = new AllCustomers { Customers = _context.Customers.ToList() }; return(View(vm)); }
public BankAccount(Customer customer, decimal initialDeposit, string accountType) { CustomerName = $"{customer.FirstName} {customer.LastName}"; AccountType = accountType; AccountNumber = accountNumber; CustomerId = customer.CustomerId; accountNumber += 123; AllBankAccounts.Add(this); AllCustomers.Add(customer); MakeDeposite(this, initialDeposit, DateTime.Now, "initial Deposit"); }
protected override void OnDispose() { foreach (CustomerViewModel custVM in AllCustomers) { custVM.Dispose(); } AllCustomers.Clear(); AllCustomers.CollectionChanged -= OnCollectionChanged; _customerRepository.CustomerAdded -= OnCustomerAddedToRepository; }
public void CollectInfo() { allCustomers = CustomerManager.Instance.allCustomers; dayNumber = DayCycle.daysPassedSinceStart; budget = Budget.Instance.Funds; waiters = RestaurantManager.Instance.Workers.OfType <Waiter>().ToList(); hosts = RestaurantManager.Instance.Workers.OfType <Host>().ToList(); cooks = RestaurantManager.Instance.Workers.OfType <Cook>().ToList(); products = Storage.Instance.products; activeRecipes = RecipeManager.Instance.ActiveRecipes; lastPersonId = Person.LastIdUsed; }
private void ShowSchedule(Schedule schedule) { if (schedule == null) { throw new ArgumentNullException("schedule"); } ScheduleId = schedule.ScheduleId; ScheduleDate = schedule.ScheduleDate; Customer = AllCustomers.Single(x => x.CustomerId == schedule.Customer.CustomerId); Signer = AllSigners.Single(x => x.SignerId == schedule.Signer.SignerId); ShowDetails(schedule.ScheduleDetails); ShowScheduledContracts(schedule); }
//Constructor for the Bank public Bank(Customer customer, decimal initialDeposit, string accountType, DateTime date) { CustomerName = $"{customer.FirstName} {customer.LastName}"; AccountNumber = accountNumber; AccountBalance = initialDeposit; AccountType = accountType; Date = date; Note = "Initial Deposit"; AllCustomers.Add(customer); MakeDeposit(initialDeposit, customer, "Inital Deposit"); accountNumber++; }
public void AllCustomersForEmail() { var results = new AllCustomers(_db) { Email = "nowhere.org" }.Execute(); foreach (var row in results) { Debug.WriteLine(row.Email); } Assert.IsTrue(results.Any()); }
void Arrive() { var customers = Enumerable.Range(0, Empirical.Sample(DefaultRS, Config.ArrivalGroupSizeProbs)).Select(i => new Customer()).ToList(); foreach (var c in customers) { c.Id = ++CustomersCount; c.ArrivalTime = ClockTime; } AllCustomers.AddRange(customers); Waiting.Add(customers); Start(); Log("{0} arrived.", customers.Count); }
private void Start() { DayCycle.Instance.onDayChangedCallback += KickLeftCustomers; if (!SaveManager.Instance.loadOnStart) { allCustomers = new AllCustomers(); allCustomers.list.Clear(); GenerateCustomersPool(); } customerGroups = new List <CustomerGroup>(); DayCycle.Instance.onDayStartedCallback += CustomersNewDay; }
public void AllCustomersNoParams() { var results = new AllCustomers(_db).Execute(); Assert.IsTrue(results.Any()); }
private void ShowDetail(int id) { SelectedCustomer = (Customer)AllCustomers.Where(c => c.ID == id).FirstOrDefault(); }
public IActionResult Index() { AllCustomers data = AllCustomers.Instance(); return(View(data.Customers)); }
private void OnCustomerAddedToRepository(object sender, CustomerAddedEventArgs e) { CustomerViewModel viewModel = new CustomerViewModel(e.NewCustomer, _customerRepository); AllCustomers.Add(viewModel); }
public bool IsExistingCustomer(Customer customer) { return(AllCustomers.Contains(customer)); }