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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        public ActionResult Index(AllCustomers query)
        {
            FillSelectLists(query);

            query.OrgId = CurrentUser.OrganizationId;
            var list = query.Execute();

            return(View(list));
        }
예제 #4
0
        public void AllCustomersCase()
        {
            var results = new AllCustomers(_db)
            {
                HasPhone = false
            }.Execute();

            Assert.IsTrue(results.All(row => string.IsNullOrEmpty(row.Phone)));
        }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
        // GET: Customer
        public ActionResult Index()
        {
            //will return all customers as a list.
            var vm = new AllCustomers
            {
                Customers = _context.Customers.ToList()
            };

            return(View(vm));
        }
예제 #8
0
 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");
 }
예제 #9
0
        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;
 }
예제 #11
0
 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);
 }
예제 #12
0
        //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++;
        }
예제 #13
0
        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());
        }
예제 #14
0
        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;
    }
예제 #16
0
        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();
 }
예제 #18
0
        public IActionResult Index()
        {
            AllCustomers data = AllCustomers.Instance();

            return(View(data.Customers));
        }
예제 #19
0
        private void OnCustomerAddedToRepository(object sender, CustomerAddedEventArgs e)
        {
            CustomerViewModel viewModel = new CustomerViewModel(e.NewCustomer, _customerRepository);

            AllCustomers.Add(viewModel);
        }
예제 #20
0
 public bool IsExistingCustomer(Customer customer)
 {
     return(AllCustomers.Contains(customer));
 }