コード例 #1
0
ファイル: CustomerAI.cs プロジェクト: ShyJohn/Shop_Sim
 // 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;
 }
コード例 #2
0
 public CustomerStatsEventArgs(CustomerStats customerStats)
 {
     if (customerStats != null)
     {
         CustomerStats = customerStats;
     }
     else
     {
         CustomerStats = new CustomerStats();
     }
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 // Set current customer to a certain custumoer
 public void SetCustomer(CustomerStats customer)
 {
     currentCustomer = customer;
 }