public Order(List <Item> ingredients, int points, OrderUI orderUI) { _points = points; _ingredients = ingredients; _orderUI = orderUI; }
protected void Page_Load(object sender, EventArgs e) { //Master.PageTitle = GlobalStrings.GetText(@"DefaultPageTitle"); //ltDescription.Text = GlobalStrings.GetText(@"DefaultPageBody"); if (!IsPostBack) { lblBidIdLabel.Text = SupplierProfileStrings.GetText("BidIdLabel", new System.Globalization.CultureInfo("he-IL")); lblOrderDateLabel.Text = SupplierProfileStrings.GetText("OrderDateLabel", new System.Globalization.CultureInfo("he-IL")); lblDealsIncludeLabel.Text = SupplierProfileStrings.GetText("DealsIncludeLabel", new System.Globalization.CultureInfo("he-IL")); lblPriceLabel.Text = SupplierProfileStrings.GetText("PriceLabel", new System.Globalization.CultureInfo("he-IL")); lblOrderIdlabel.Text = SupplierProfileStrings.GetText("OrderIdlabel", new System.Globalization.CultureInfo("he-IL")); LblUserLabel.Text = SupplierProfileStrings.GetText("AppUserLabel", new System.Globalization.CultureInfo("he-IL")); LblUserPhoneLabel.Text = SupplierProfileStrings.GetText("AppUserPhoneLabel", new System.Globalization.CultureInfo("he-IL")); Int64 OrderId = Request.QueryString["OrderId"] != null?Convert.ToInt64(Request.QueryString["OrderId"]) : 0; OrderUI order = OrderController.GetOrderById(OrderId); if (order != null) { //order.user. lblOrderDate.Text = order.OrderDate.ToShortDateString(); lblOrderId.Text = order.OrderId.ToString(); lblPrice.Text = order.Price.ToString(); lblBidId.Text = order.BidId.ToString(); LblUser.Text = order.user.Email; LblUserPhone.Text = order.user.Phone; lvDealsInclude.DataSource = order.LstProduct; lvDealsInclude.DataBind(); } } }
public bool WholeMenu(List <OrderData> orderData, List <StockData> stockData, List <MenuData> menuData) { Console.Clear(); Console.WriteLine("Restaurant Manager:"); Console.WriteLine("Choose an option:"); Console.WriteLine("1) Use the Stock Manager"); Console.WriteLine("2) Use the Menu Manager"); Console.WriteLine("3) Use the Order Manager"); Console.WriteLine("4) Exit"); Console.Write("\r\nSelect an option: "); switch (Console.ReadLine()) { case "1": StockUI.StockMenu(stockData); GenericTextProccesor.SaveToTextFile(StockDataAccess.stockData, "Stock.csv"); return(true); case "2": MenuUI.RestMenu(menuData, stockData); GenericTextProccesor.SaveToTextFile(MenuDataAccess.menuData, "Menu.csv"); return(true); case "3": OrderUI.OrderMenu(orderData, menuData, stockData); GenericTextProccesor.SaveToTextFile(OrderDataAccess.orderData, "Order.csv"); return(true); case "4": return(false); default: return(true); } }
public void Reset() { Zero(); orderUI = null; dead = false; int numLeft = 3; int initNumLeft = numLeft; while (numLeft == initNumLeft) { foreach (SushiType st in System.Enum.GetValues(typeof(SushiType))) { Items[st] = Random.Range(0, numLeft + 1); numLeft -= Items[st]; } } initTime = timeLeft = Mathf.Lerp(Orders.maxAmtTime, Orders.minAmtTime, Random.Range(0f, 1f) * Mathf.Clamp(GameManager.Score / GameManager.ScoreMaxDifficulty, 0.4f, 1f)); orderUI = ((GameObject)GameObject.Instantiate( Orders.instance.prefab, Orders.instance.OrderUIContainer.position, Quaternion.identity, Orders.instance.OrderUIContainer )).GetComponent <OrderUI>(); orderUI.SupplyValues(Items); }
/// <summary> /// Спавн покупателя с текущим заказом /// </summary> /// <param name="bSpawnPoint"> Точка спавна </param> void Spawn(BuyerSpawnPoint bSpawnPoint) { int index = UnityEngine.Random.Range(0, buyerPrefabs.Length); var newBuyer = Instantiate(buyerPrefabs[index], bSpawnPoint.spawnPoint); Buyer buyer = newBuyer.GetComponent <Buyer>(); newBuyer.name = $"Char_{currentIndex}"; var orderPanel = Instantiate(orderUI, canvas.transform); OrderUI orderPanelUI = orderPanel.GetComponent <OrderUI>(); orderPanel.name = $"{newBuyer.name}_orderUI"; buyer.orderUI = orderPanelUI; orderPanelUI.buyer = buyer; orderPanel.GetComponent <RectTransform>().anchoredPosition = GetCoordinates(bSpawnPoint.spawnPoint, charUI_offsetX, charUI_offsetY, canvas); bSpawnPoint.IsEmpty = false; var order = orders[currentIndex]; orderPanelUI.meals[order.Length - 1].SetActive(true); foreach (var meal in order) { var food = Instantiate(meal, orderPanelUI.meals[order.Length - 1].transform); buyer.dishList.Add(food); } buyers.Add(buyer); countBuyers--; currentIndex++; UpdateBuyersCount(); }
private void login() { string username = txtUserName.Text.Trim(); string password = txtPassWord.Text.Trim(); List <Account> list = Account.GetAccount(username, password); if (list.Count > 0) { if (list[0].Type) { frmAdmin frmAdmin = new frmAdmin(); frmAdmin.Show(); txtUserName.Text = ""; txtPassWord.Text = ""; this.Hide(); } else { OrderUI order = new OrderUI(list[0].Displayname); order.Show(); txtUserName.Text = ""; txtPassWord.Text = ""; this.Hide(); } } else { MessageBox.Show("Tên Đăng Nhập hoặc Mật Khẩu không chính xác! Xin vui lòng nhập lại!"); } }
// Use this for initialization void Awake() { CustomerInteractionUI = FindObjectOfType <CustomerInteractionUI>(); pcTrig = FindObjectOfType <PcTrigger>(); ShopInventoryUi = FindObjectOfType <ShopInventoryUi>(); orderui = orderP.GetComponent <OrderUI> (); }
public static void MakeUIOrder(Customer _customer, string _orderString) { OrderUI _order = Instantiate(t._orderPrefab).GetComponent <OrderUI>(); _order.SetText(_orderString); _order.transform.SetParent(t._orderParent); t._customerOrders.Add(_customer, _order); }
public void UpdateStatus(OrderData orderData, string companyName) { var orderUI = new OrderUI(); var id = orderUI.GetOrderID(orderData, companyName); var status = orderUI.GetNewStatus(); orderUI.SetNewStatus(orderData, id, status); }
public static OrderUI OrderFromDTO(OrderDTO orderdto) { OrderUI result = new OrderUI(); result.Phone = PhoneFromDTO(orderdto.phone); result.User = UserFromDTO(orderdto.user); result.dateTime = orderdto.time; return(result); }
public static OrderDTO OrderFromUI(OrderUI orderui) { OrderDTO result = new OrderDTO(); result.phone = PhoneFromUI(orderui.Phone); result.user = UserFromUI(orderui.User); result.time = orderui.dateTime; return(result); }
public void Initialize() { OrdersPanelScript = GameObject.Find(goMonitor).transform.Find(goUIScreen).Find(goCompCanvas).Find(goApps).Find(goOrdersPanel).gameObject.GetComponent <OrderUI>(); hudScript = GameObject.Find("HudCanvas").GetComponent <HudMain>(); note = GameObject.Find("HudCanvas").transform.Find("Phone").gameObject.GetComponent <Notifications>(); achiev = GameObject.Find("NotificationCanvas").transform.Find("Acheivments").gameObject.GetComponent <AchievmentsUI>(); UIController = GameObject.Find("UiController").GetComponent <UIController>(); shopManager = GameObject.Find("Shop").transform.Find("ItemManager").GetComponent <ShopManagerClass> (); }
public MainWindow() { InitializeComponent(); OrderUI.Navigate(new MenuCategorySelection()); OrderControl.NavigationService = OrderUI.NavigationService; Order order = new Order(); DataContext = order; }
private void OnDone(object sender, RoutedEventArgs args) { if (OrderUI.NavigationService.CanGoBack) { OrderUI.GoBack(); } else { OrderUI.NavigationService.Navigate(new MenuCategorySelection()); } }
/// <summary> /// Order UI and Order data Generator /// </summary> /// <param name="numIng"></param> /// <returns></returns> public Order GenerateOrder(float rad, int numIng, float duration) { // listes Elements a generar x crear ordre List <Item> listIng = new List <Item>(); List <ItemUI> listIngUI = new List <ItemUI>(); if (numIng > 0) { for (int i = 0; i < numIng; i++) { // UI elements GameObject m; // item elements Item n; /// Decideixo quin ingredinent si un o l'altre amb random // float rad = Random.Range(0.0f, 1.0f); if (rad > 0.5f) { n = Ing1Pool.Instance.GetObjFromPool(); m = Instantiate(Ing1UIPrefab); } else { n = Ingredient2Pool.Instance.GetObjFromPool(); m = Instantiate(Ing2UIPrefab); } n.gameObject.SetActive(false); //// Adegirixo a llistes a generar la UI i els obj Ingreienr o Item ItemUI mn = m.GetComponent <ItemUI>(); listIngUI.Add(mn); listIng.Add(n); } } // Creo Obj order passat li la list ingredients Order order = new Order(listIng, 8, duration); // Creao obj de tipus OrdreUI GameObject orderUI = Instantiate(OrderUIPrefb, parentUI); // li poso pare de la llista de elements a UI orderUI.transform.SetParent(parentUI); // Trec el script OrdrerUI del obj OrderUI orderUIS = orderUI.GetComponent <OrderUI>(); // afegeixo els la llista d'ingredients UI generada al ordre orderUIS.ItemUIlist.AddRange(listIngUI); // genero i ordeno la llista ingredienta a UI orderUIS.generateItemsUI(); // Assigno obj OrderUi a l'order order.SetOrderUi(orderUIS); return(order); }
private void Button_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("Confirm this order", "Confirm", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { order = new OrderUI { Phone = phone, dateTime = DateTime.Now, User = user }; OrderDTO ord = Mapper.OrderFromUI(order); orderclient.CreateOrder(ord); } else { this.Close(); } }
private void Update() { for (int i = 0; i < activeOrders.Count; i++) { if (i > orderPanels.Count - 1) { OrderUI newPanel = Instantiate(OrderPrefab) as OrderUI; newPanel.transform.parent = this.gameObject.transform; orderPanels.Add(newPanel); } OrderUI panel = orderPanels[i]; panel.ingredients = activeOrders[i]; panel.transform.position = new Vector3(i % 5 * 100 + 50, 450 - (i / 5 * 100)); } }
public OrderUI Add(OrderUI Entity, long companyid) { var Order = Mapper.Map <OrderUI, Order>(Entity); Order.OrderDate = DateTime.Now; _unitOfWork.OrderRepository.Insert(Order); _unitOfWork.Save(); if (Order != null) { var taskModel = Mapper.Map <Order, OrderUI>(Order); return(taskModel); } else { return(null); } }
public OrderUI Update(long id, OrderUI Entity, long companyid) { var requestModel = Mapper.Map <OrderUI, Order>(Entity); requestModel.PK_Id = id; _unitOfWork.OrderRepository.Update(requestModel); _unitOfWork.Save(); if (requestModel != null) { var taskModel = Mapper.Map <Order, OrderUI>(requestModel); return(taskModel); } else { return(null); } }
public bool Delete(long Id, string basePath, OrderUI Entity, long companyid) { if (Id > 0) { //_unitOfWork.bank.Delete(Id); var Order = _unitOfWork.OrderRepository.GetByID(Id); Order.ModifiedBy = Entity.MBy; Order.ModifiedDate = Entity.MDt; Order.Status = RecordStatus.Deleted; _unitOfWork.OrderRepository.Update(Order); _unitOfWork.Save(); return(true); } else { return(false); } }
public ActionResult PlaceOrder() { CustomerClass User = Repo.LoadCustomerByUsername((string)TempData["user"]); User.PreviousOrders = (List <OrderClass>)Repo.LoadOrdersByCustomer(User); CustomerUI customer = Mapper.Map(User); if (customer.SuggestedOrder == null) { OrderUI order = new OrderUI(); order.Customer = customer; TempData["order"] = order; return(View(order)); } List <int> RecentStoreZips = User.PreviousOrders.Where(po => po.DatePlaced.Subtract(DateTime.Now) < TimeSpan.FromHours(2)).Select(po => po.Store.Address.Zip).ToList(); customer.SuggestedOrder.PossibleAddresses = customer.Addresses.Where(a => !RecentStoreZips.Contains(a.Zip)).ToList(); TempData["order"] = customer.SuggestedOrder; return(View(customer.SuggestedOrder)); }
public ActionResult PlaceOrder(OrderUI order) { try { if (ModelState.IsValid) { order.Customer = Mapper.Map(Repo.LoadCustomerByUsername(order.CustomerUsername)); order.Store = Mapper.Map(Repo.LoadLocationByID(order.StoreID)); order.DeliveryAddress = Mapper.Map(Repo.LoadAddressByID(order.AddressID)); OrderClass TheOrder = Mapper.Map(order); TheOrder.VerifyOrder(); Repo.PlaceOrder(TheOrder); } return(RedirectToAction(nameof(Index))); } catch (Exception) { return(View(order)); } }
/// <summary> /// constructor for the class /// </summary> public MainWindow() { InitializeComponent(); Order order = DataContext as Order; OrderUI.Navigate(new MenuCategorySelection()); Order.NavigationService = OrderUI.NavigationService; /* * if (order != null) * { * order.Items.Add(new PrehistoricPBJ()); * order.Items.Add(new Sodasaurus()); * order.Items.Add(new Fryceritops()); * SteakosaurusBurger sb = new SteakosaurusBurger(); * sb.HoldPickle(); * sb.HoldBun(); * order.Items.Add(sb); * } */ }
public Order AddOrderItem(ProductData productData, Buyer buyer, int id) { var product = new Product(); var productUI = new ProductUI(); product = productUI.AddProductToOrder(productData); var buyerClient = new BuyerInterface(); var orderUI = new OrderUI(); var totalPrice = product.Price; var val = orderUI.GetItemsCount(); var logger = new Logger(); logger.SaveIntoFile(product.Name + " was added to the order"); var value = productUI.UpdateProduct(productData,product.Id, val,"dec"); totalPrice *= value; var promo = buyerClient.GetPromo(); var discount = product.ProductDiscount; if (product.DiscountPromoCode.Equals(promo)) { discount += product.PersonalDiscount; } totalPrice = GetDiscount(totalPrice, discount); var order = new Order(id,product, value, discount, 0.0m, totalPrice, Order.OrderStatus.Undefined, buyer); return order; }
public override void Get(HttpRequest Request, HttpResponse Response, params string[] PathParams) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetMaxAge(TimeSpan.Zero); try { Int64 SupplierId; if (IsAuthorizedRequestSupplier(Request, Response, true, out SupplierId)) { Response.ContentType = @"application/json"; using (StreamWriter streamWriter = new StreamWriter(Response.OutputStream)) { using (JsonTextWriter jsonWriter = new JsonTextWriter(streamWriter)) { Int64 OrderId = Request.QueryString["order_id"] != null?Int64.Parse(Request.QueryString["order_id"].ToString()) : 0; OrderUI orderUI = OrderController.GetOrderById(OrderId, SupplierId); jsonWriter.WriteStartObject(); jsonWriter.WritePropertyName(@"order_id"); jsonWriter.WriteValue(orderUI.OrderId); jsonWriter.WritePropertyName(@"order_date"); jsonWriter.WriteValue(orderUI.OrderDate.ToShortDateString()); jsonWriter.WritePropertyName(@"order_time"); jsonWriter.WriteValue(orderUI.OrderDate.ToShortTimeString()); jsonWriter.WritePropertyName(@"first_name"); jsonWriter.WriteValue(orderUI.user != null ? orderUI.user.FirstName : ""); jsonWriter.WritePropertyName(@"last_name"); jsonWriter.WriteValue(orderUI.user != null ? orderUI.user.LastName : ""); jsonWriter.WritePropertyName(@"total_price"); jsonWriter.WriteValue(orderUI.Price); jsonWriter.WritePropertyName(@"gift"); jsonWriter.WriteValue(orderUI.Gift); jsonWriter.WritePropertyName(@"special_instructions"); jsonWriter.WriteValue(orderUI.SpecialInstructions); jsonWriter.WritePropertyName(@"is_supplied"); jsonWriter.WriteValue(orderUI.SuppliedDate < DateTime.Now); jsonWriter.WritePropertyName(@"city"); jsonWriter.WriteValue(orderUI.City); jsonWriter.WritePropertyName(@"email"); jsonWriter.WriteValue(orderUI.user != null ? orderUI.user.Email : ""); jsonWriter.WritePropertyName(@"phone"); jsonWriter.WriteValue(orderUI.user != null ? orderUI.user.Phone : ""); string address = (orderUI.user != null ? String.Format("{0} {1} {2}, {3} {4}, {5} {6}", Snoopi.web.Localization.PushStrings.GetText("Street", new CultureInfo("he-IL")), orderUI.user.Street, orderUI.user.HouseNum, Snoopi.web.Localization.PushStrings.GetText("ApartmentNumber", new CultureInfo("he-IL")), orderUI.user.ApartmentNumber, Snoopi.web.Localization.PushStrings.GetText("Floor", new CultureInfo("he-IL")), orderUI.user.Floor) : ""); jsonWriter.WritePropertyName(@"address"); jsonWriter.WriteValue(address); jsonWriter.WritePropertyName(@"products"); jsonWriter.WriteStartArray(); foreach (BidProductUI item in orderUI.LstProduct) { jsonWriter.WriteStartObject(); jsonWriter.WritePropertyName(@"product_id"); jsonWriter.WriteValue(item.ProductId); jsonWriter.WritePropertyName(@"product_name"); jsonWriter.WriteValue(item.ProductName); jsonWriter.WritePropertyName(@"product_amount"); jsonWriter.WriteValue(item.ProductAmount); jsonWriter.WritePropertyName(@"order_amount"); jsonWriter.WriteValue(item.Amount); jsonWriter.WritePropertyName(@"product_image"); jsonWriter.WriteValue(item.ProductImage); jsonWriter.WritePropertyName(@"product_price"); jsonWriter.WriteValue(item.Amount * item.Price); jsonWriter.WriteEndObject(); } jsonWriter.WriteEndArray(); jsonWriter.WriteEndObject(); } } } } catch (Exception) { } }
public override void Get(HttpRequest Request, HttpResponse Response, params string[] PathParams) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetMaxAge(TimeSpan.Zero); try { Int64 AppUserId; if (IsAuthorizedRequest(Request, Response, true, out AppUserId)) { Int64 OrderId = Request.QueryString["order_id"] != null?Int64.Parse(Request.QueryString["order_id"].ToString()) : 0; Response.ContentType = @"application/json"; using (StreamWriter streamWriter = new StreamWriter(Response.OutputStream)) { using (JsonTextWriter jsonWriter = new JsonTextWriter(streamWriter)) { OrderUI orderUI = OrderController.GetOrderById(OrderId); jsonWriter.WriteStartObject(); jsonWriter.WritePropertyName(@"order_id"); jsonWriter.WriteValue(orderUI.OrderId); jsonWriter.WritePropertyName(@"supplier_id"); jsonWriter.WriteValue(orderUI.SupplierId); jsonWriter.WritePropertyName(@"order_date"); jsonWriter.WriteValue(orderUI.OrderDate.ToShortDateString()); jsonWriter.WritePropertyName(@"supplier_name"); jsonWriter.WriteValue(orderUI.SupplierName); jsonWriter.WritePropertyName(@"total_price"); jsonWriter.WriteValue(orderUI.Price); jsonWriter.WritePropertyName(@"SpecialInstructions"); jsonWriter.WriteValue(orderUI.SpecialInstructions); jsonWriter.WritePropertyName(@"is_enable_received"); jsonWriter.WriteValue(orderUI.ReceviedDate == null ? (orderUI.OrderDate < DateTime.UtcNow.AddHours(-24) ? false : true) : true); jsonWriter.WritePropertyName(@"isSendReceived"); jsonWriter.WriteValue(orderUI.ReceviedDate != null ? true : false); jsonWriter.WritePropertyName(@"isSupplied"); jsonWriter.WriteValue(orderUI.SuppliedDate == null ? false : true); jsonWriter.WritePropertyName(@"products"); jsonWriter.WriteStartArray(); foreach (BidProductUI item in orderUI.LstProduct) { jsonWriter.WriteStartObject(); jsonWriter.WritePropertyName(@"product_id"); jsonWriter.WriteValue(item.ProductId); jsonWriter.WritePropertyName(@"product_name"); jsonWriter.WriteValue(item.ProductName); jsonWriter.WritePropertyName(@"product_amount"); jsonWriter.WriteValue(item.Amount); jsonWriter.WritePropertyName(@"order_amount"); jsonWriter.WriteValue(item.Amount); jsonWriter.WritePropertyName(@"product_image"); jsonWriter.WriteValue(item.ProductImage); jsonWriter.WriteEndObject(); } jsonWriter.WriteEndArray(); jsonWriter.WriteEndObject(); } } } } catch (Exception) { } }
public void SetOrderUi(OrderUI ordrrui) { _orderUI = ordrrui; _orderUI.duration = duration; }