Пример #1
0
        public async Task <IActionResult> Edit(string id, [Bind("customerLineId,createdAt,customerId,street1,LocLat,LocLong,PostCode,city,country,province")] CustomerLine customerLine)
        {
            if (id != customerLine.customerLineId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customerLine);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerLineExists(customerLine.customerLineId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["customerId"] = new SelectList(_context.Customer, "customerId", "customerId", customerLine.customerId);
            return(View(customerLine));
        }
Пример #2
0
        public async Task <IActionResult> Edit(string id, [Bind("customerLineId,jobTitle,customerId,firstName,lastName,middleName,nickName,gender,salutation,mobilePhone,officePhone,fax,personalEmail,workEmail,createdAt")] CustomerLine customerLine)
        {
            if (id != customerLine.customerLineId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customerLine);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerLineExists(customerLine.customerLineId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["customerId"] = new SelectList(_context.Customer, "customerId", "customerId", customerLine.customerId);
            return(View(customerLine));
        }
    void Awake()
    {
        agent        = GetComponent <NavMeshAgent>();
        thisCustomer = GetComponent <Customer>();
        customerLine = FindObjectOfType <CustomerLine>();

        endPos = transform.position + (Vector3.right * 14);
    }
Пример #4
0
        public async Task <IActionResult> Create([Bind("customerLineId,jobTitle,customerId,firstName,lastName,middleName,nickName,gender,salutation,mobilePhone,officePhone,fax,personalEmail,workEmail,createdAt")] CustomerLine customerLine)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerLine);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["customerId"] = new SelectList(_context.Customer, "customerId", "customerId", customerLine.customerId);
            return(View(customerLine));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("customerLineId,createdAt,customerId,street1,LocLat,LocLong,PostCode,city,country,province")] CustomerLine customerLine)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerLine);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["customerId"] = new SelectList(_context.Customer, "customerId", "customerId", customerLine.customerId);
            return(View(customerLine));
        }
    void Start()
    {
        gm           = FindObjectOfType <GameManager>();
        customerLine = gm.GetComponent <CustomerLine>();
        moneyTracker = gm.GetMoneyTracker();

        customerAudio.ChangeCustomerAudio(CustomerAudio.CustomerAudioStates.Walking);

        currentOrderTime = startOrderTime + 1;

        head = gameObject.transform.GetChild(0).gameObject.transform.GetChild(3).gameObject.GetComponent <MeshRenderer>();
    }
Пример #7
0
        private void NewCustomerAdded(Customer customer)
        {
            if (customer == null)
            {
                return;
            }
            var control = new CustomerLine(baseForm, customer)
            {
                Margin = Padding.Empty
            };

            clsCustomers.AddControl(control);
            sblCustomers.Text = clsCustomers.Controls.Count.ToString();
        }
Пример #8
0
        // GET: CustomerLine/Create
        public IActionResult Create(string masterid, string id)
        {
            var check    = _context.CustomerLine.SingleOrDefault(m => m.customerLineId == id);
            var selected = _context.Customer.SingleOrDefault(m => m.customerId == masterid);

            ViewData["customerId"] = new SelectList(_context.Customer, "customerId", "customerId");
            if (check == null)
            {
                CustomerLine objline = new CustomerLine();
                objline.customer   = selected;
                objline.customerId = masterid;
                return(View(objline));
            }
            else
            {
                return(View(check));
            }
        }
Пример #9
0
        private void UpdateList()
        {
            clsCustomers.SuspendLayout();

            clsCustomers.ClearList();
            var customers = CustomerController.Instance.GetCustomers();

            foreach (var customer in customers)
            {
                var control = new CustomerLine(baseForm, customer)
                {
                    Margin = Padding.Empty
                };
                clsCustomers.AddControl(control, true);
            }
            sblCustomers.Text = clsCustomers.Controls.Count.ToString();

            clsCustomers.ResumeLayout();
        }
Пример #10
0
        public async Task <IActionResult> PostCustomerLine([FromBody] CustomerLine customerLine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (string.IsNullOrEmpty(customerLine.customerLineId))
            {
                customerLine.customerLineId = Guid.NewGuid().ToString();
                _context.CustomerLine.Add(customerLine);
                await _context.SaveChangesAsync(); return(Json(new { success = true, message = "Η Προσθήκη της Διεύθυνσης " + customerLine.street1 + " " + customerLine.city + " έγινε με επιτυχία." }));
            }
            else
            {
                _context.Update(customerLine);
                await _context.SaveChangesAsync();

                return(Json(new { success = true, message = "Η Επεξεργασία της Διεύθυνσης " + customerLine.street1 + " " + customerLine.city + " έγινε με επιτυχία" }));
            }
        }
Пример #11
0
        public async Task <IActionResult> PostCustomerLine([FromBody] CustomerLine customerLine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (customerLine.customerLineId == string.Empty)
            {
                customerLine.customerLineId = Guid.NewGuid().ToString();
                _context.CustomerLine.Add(customerLine);
                await _context.SaveChangesAsync();

                return(Json(new { success = true, message = "Add new data success." }));
            }
            else
            {
                _context.Update(customerLine);
                await _context.SaveChangesAsync();

                return(Json(new { success = true, message = "Edit data success." }));
            }
        }
Пример #12
0
 public ObjectiveQueue(int maxObjectives, CustomerLine customerLine)
 {
     objectives        = new Objective[maxObjectives];
     this.customerLine = customerLine;
 }
Пример #13
0
 public void Start()
 {
     customerLine   = FindObjectOfType <CustomerLine>();
     ObjectiveQueue = new ObjectiveQueue(GameManager.Instance.Settings.MaxObjectives, customerLine);
 }
Пример #14
0
 // Use this for initialization
 void Start()
 {
     gamemanager  = GameObject.Find("Managers").GetComponent <GameManager>();
     customerLine = GameObject.Find("CustomerLine").GetComponent <CustomerLine>();
 }
Пример #15
0
        public string PostCustomer(PelicanCustomer instance,
                                   PelicanContext context = null,
                                   Guid?companyFileId     = null)
        {
            var authorizationService = new AuthorizationService();

            context       = context ?? PelicanContext.CreateFromApplicationSettings();
            companyFileId = companyFileId ?? context.CompanyFileId;

            var apiContext = authorizationService.GetAuthorizedContext(context,
                                                                       companyFileId.Value);

            try
            {
                if (_taxCode == null)
                {
                    var taxCodeService = new TaxCodeService(apiContext.ApiConfiguration);
                    var taxCodes       = taxCodeService.GetRange(apiContext.CompanyFile,
                                                                 null,
                                                                 apiContext.CompanyFileCredentials);
                    _taxCode = taxCodes.Items.First(_ => _.Code == "GST");
                }

                var service = new CustomerService(apiContext.ApiConfiguration);
                var entity  = new Customer();
                entity.UID         = Guid.NewGuid();
                entity.InvoiceType = InvoiceLayoutType.Item;
                entity.Customer    = new CustomerLink
                {
                    UID = Guid.Parse(instance.Customer.Id)
                };
                entity.Number = string.Format("SJ{0:D5}",
                                              _referenceNbr++);
                entity.Date = DateTime.Today;
                var invoiceLines = new List <CustomerLine>();
                for (var index = 0;
                     index < instance.SaleableItems.Count();
                     index++)
                {
                    var saleableItem = instance.SaleableItems[index];
                    var item         = new CustomerLine();
                    item.Item = new ItemLink
                    {
                        UID = Guid.Parse(saleableItem.Id)
                    };
                    item.RowID        = index;
                    item.ShipQuantity = 1;
                    item.Total        = saleableItem.Price;
                    item.TaxCode      = new TaxCodeLink
                    {
                        UID = _taxCode.UID
                    };
                    invoiceLines.Add(item);
                }
                entity.Lines       = invoiceLines;
                entity.TotalAmount = instance.SaleableItems.Sum(_ => _.Price);
                entity.Comment     = "Entered via Pelican";
                return(service.Insert(apiContext.CompanyFile,
                                      entity,
                                      apiContext.CompanyFileCredentials));
            }
            catch (Exception ex)
            {
                switch (ex.GetType()
                        .Name)
                {
                case "WebException":
                    Debug.WriteLine(FormatMessage((WebException)ex));
                    break;

                case "ApiCommunicationException":
                    Debug.WriteLine(FormatMessage((WebException)ex.InnerException));
                    break;

                case "ApiOperationException":
                    Debug.WriteLine(ex.Message);
                    break;

                default:
                    Debug.WriteLine(ex.Message);
                    break;
                }
            }
            return(null);
        }
Пример #16
0
    public void SetupLevel(int selectedDay)
    {
        // setup day
        GetComponent <GameManager>().SetDay(levelData.dataArray[selectedDay].Daynum,
                                            levelData.dataArray[selectedDay].Totalcustomers,
                                            levelData.dataArray[selectedDay].Daylength,
                                            levelData.dataArray[selectedDay].Scoregoal,
                                            levelData.dataArray[selectedDay].Startwogoal,
                                            levelData.dataArray[selectedDay].Starthreegoal);

        if (selectedDay == 0)
        {
            startOfDaySummary.SetActive(true);
        }
        startOfDaySummary.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent <TextMeshProUGUI>().text = "Day " + (selectedDay + 1);
        startOfDaySummary.transform.GetChild(0).gameObject.transform.GetChild(1).gameObject.GetComponent <TextMeshProUGUI>().text = narrativeBodyText[selectedDay];
        starOneScore.GetComponent <TextMeshProUGUI>().text   = levelData.dataArray[selectedDay].Scoregoal.ToString();
        starTwoScore.GetComponent <TextMeshProUGUI>().text   = levelData.dataArray[selectedDay].Startwogoal.ToString();
        starThreeScore.GetComponent <TextMeshProUGUI>().text = levelData.dataArray[selectedDay].Starthreegoal.ToString();
        CustomerLine customerLine = FindObjectOfType <CustomerLine>();

        // setup customer lines
        switch (levelData.dataArray[selectedDay].Numcustomerlines)
        {
        case 0:
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Center].GetComponent <CustomerLinePos>());
            customerLines[(int)CustomerLinePoses.Right].HideItem();
            customerLines[(int)CustomerLinePoses.Left].HideItem();
            break;

        case 1:
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Center].GetComponent <CustomerLinePos>());
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Right].GetComponent <CustomerLinePos>());
            customerLines[(int)CustomerLinePoses.Left].HideItem();
            break;

        default:
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Center].GetComponent <CustomerLinePos>());
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Right].GetComponent <CustomerLinePos>());
            customerLine.AddNewCustomerLine(customerLines[(int)CustomerLinePoses.Left].GetComponent <CustomerLinePos>());
            break;
        }

        // setup ovens
        switch (levelData.dataArray[selectedDay].Numofovens)
        {
        case 0:
            ovens[(int)OvensSpots.Bottom].HideItem();
            ovens[(int)OvensSpots.Top].HideItem();
            break;

        case 1:
            ovens[(int)OvensSpots.Top].HideItem();
            break;
        }

        // setup toppings
        if (!levelData.dataArray[selectedDay].Pineapple)
        {
            toppings[(int)ToppingTypes.Pineapple].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Pineapple].TurnOnUpgrade();
        }

        if (!levelData.dataArray[selectedDay].Laundrypod)
        {
            toppings[(int)ToppingTypes.Laundrypod].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Laundrypod].TurnOnUpgrade();
        }

        if (!levelData.dataArray[selectedDay].Beetroot)
        {
            toppings[(int)ToppingTypes.Beetroot].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Beetroot].TurnOnUpgrade();
        }

        if (!levelData.dataArray[selectedDay].Cactus)
        {
            toppings[(int)ToppingTypes.Cactus].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Cactus].TurnOnUpgrade();
        }

        if (!levelData.dataArray[selectedDay].Starfish)
        {
            toppings[(int)ToppingTypes.Starfish].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Starfish].TurnOnUpgrade();
        }

        if (!levelData.dataArray[selectedDay].Honeycomb)
        {
            toppings[(int)ToppingTypes.Honeycomb].HideItem();
        }
        else
        {
            toppings[(int)ToppingTypes.Honeycomb].TurnOnUpgrade();
        }

        // setup cheese press
        if (!levelData.dataArray[selectedDay].Cheesepress)
        {
            cheesePress.HideItem();
        }

        else
        {
            cheesePress.TurnOnUpgrade();
            switch (levelData.dataArray[selectedDay].Cheeses)
            {
            case 0:
                cheesePress.transform.GetChild(0).gameObject.SetActive(false);
                cheesePress.transform.GetChild(1).gameObject.SetActive(false);
                cheesePress.transform.GetChild(2).gameObject.SetActive(false);
                break;

            case 1:
                cheesePress.transform.GetChild(0).gameObject.SetActive(true);
                cheesePress.transform.GetChild(1).gameObject.SetActive(false);
                cheesePress.transform.GetChild(2).gameObject.SetActive(false);
                break;

            case 2:
                cheesePress.transform.GetChild(0).gameObject.SetActive(true);
                cheesePress.transform.GetChild(1).gameObject.SetActive(true);
                cheesePress.transform.GetChild(2).gameObject.SetActive(false);
                break;

            case 3:
                cheesePress.transform.GetChild(0).gameObject.SetActive(true);
                cheesePress.transform.GetChild(1).gameObject.SetActive(true);
                cheesePress.transform.GetChild(2).gameObject.SetActive(true);
                break;
            }
        }

        // setup order creation
        GetComponent <OrderCreation>().SetDayToppingValues(levelData.dataArray[selectedDay].Mintopping,
                                                           levelData.dataArray[selectedDay].Maxtopping,
                                                           levelData.dataArray[selectedDay].Toppingrange);
    }