// Start is called before the first frame update private void Start() { agent = GetComponent <NavMeshAgent>(); stats = GetComponent <CustomerStats>(); shoppingList = Utility.Instance.GenerateShoppingList(shoppingListSize); customerDestroyerPosition = GameObject.FindGameObjectWithTag("CustomerDestroyer").GetComponent <Transform>().position; }
public CustomerStatsEventArgs(CustomerStats customerStats) { if (customerStats != null) { CustomerStats = customerStats; } else { CustomerStats = new CustomerStats(); } }
public async Task <IActionResult> Stats(CustomerStats s) { var postGroups = _context.Customer.GroupBy(m => m.Postcode); var pStats = postGroups.Select(g => new CustomerStats { PostC = g.Key, PCCount = g.Count() }); ViewBag.cinfo = await pStats.ToListAsync(); var roomGroups = _context.Booking.GroupBy(m => m.RoomID); var rStats = roomGroups.Select(g => new CustomerStats { roomID = g.Key, roomCount = g.Count() }); ViewBag.binfo = await rStats.ToListAsync(); return(View(s)); }
public CustomerStats ReadCustomerStats() { using (var db = DbDelegate()) { var stats = new CustomerStats(); stats.Active = db.Set <CustomerDAL>().Where(c => c.Status == "A").Count(); stats.Total = db.Set <CustomerDAL>().Count(); stats.WithEmail = db.Set <CustomerDAL>().Where(c => !string.IsNullOrEmpty(c.Email)).Count(); stats.WithBankDraft = db.Set <CustomerDAL>().Where(c => c.DraftActive == "Y").Count(); stats.WithBudgetPayments = db.Set <CustomerDAL>().Where(c => c.BudgetPymtAmt > 0).Count(); stats.PaidInFull = db.Set <CustomerDAL>().Where(c => c.CurrentDue == 0).Count(); stats.CurrentDue = db.Set <CustomerDAL>().Where(c => c.CurrentDue > 0).Count(); stats.PastDue = db.Set <CustomerDAL>().Where(c => c.PastDue > 0).Count(); stats.TotalPastDue = db.Set <CustomerDAL>().Select(t => t.PastDue ?? 0).Sum(); stats.AveragePastDue = stats.TotalPastDue / stats.PastDue; stats.ErrorPayments = db.Set <PmtEntryDAL>().Where(c => c.Status == 99).Count(); return(stats); } }
// Set current customer to a certain custumoer public void SetCustomer(CustomerStats customer) { currentCustomer = customer; }