Exemplo n.º 1
0
        public DeliveryItem Add(DeliveryItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }
            item.Id = _nextId++;

            var product = repository.Products.Find(p => p.Id == item.ProductId);

            if (product == null)
            {
                item.ProductId = 0;
            }
            else
            {
                item.Product = product;
            }

            var requestDelivery = repository.RequestDeliverys.Find(r => r.Id == item.RequestDeliveryId);

            if (requestDelivery == null)
            {
                item.RequestDeliveryId = 0;
            }
            else
            {
                item.RequestDelivery = requestDelivery;
            }

            repository.DeliveryItems.Add(item);
            return(item);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Delivers the message asynchronous.
        /// </summary>
        /// <param name="deliveryItem">The delivery item.</param>
        /// <param name="autoCloseConnection">
        ///     If set to <c>true</c> will close connection immediately after delivering the message.
        ///     If caller is sending multiple messages, optionally set to false to leave the mail service connection open.
        /// </param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>System.Threading.Tasks.Task&lt;System.String&gt;.</returns>
        /// <exception cref="System.Exception"></exception>
        /// <remarks>The implementor should return a provider specific ID value.</remarks>
        protected override async Task <string> DeliverMessageAsync(
            DeliveryItem deliveryItem,
            bool autoCloseConnection = true, //not used in this mailer
            CancellationToken token  = default(CancellationToken))
        {
            var sgFrom = new EmailAddress(deliveryItem.FromEmailAddress, deliveryItem.FromDisplayName);

            var sgTo      = new EmailAddress(deliveryItem.ToEmailAddress, deliveryItem.ToDisplayName);
            var sgMessage = new SendGridMessage
            {
                From = sgFrom,

                Personalizations = new List <Personalization>
                {
                    new Personalization
                    {
                        Tos = new List <EmailAddress> {
                            sgTo
                        },
                        Subject       = deliveryItem.ProcessSubstitutions(deliveryItem.Subject),
                        Substitutions = new Dictionary <string, string>(deliveryItem.Substitutions)
                    }
                }
            };

            if (!string.IsNullOrEmpty(deliveryItem.ReplyToEmailAddress))
            {
                sgMessage.ReplyTo = new EmailAddress(deliveryItem.ReplyToEmailAddress, deliveryItem.ReplyToDisplayName);
            }

            if (deliveryItem.Body is ContentBody body)
            {
                sgMessage.HtmlContent      = deliveryItem.ProcessSubstitutions(body.HtmlContent);
                sgMessage.PlainTextContent = deliveryItem.ProcessSubstitutions(body.PlainTextContent);
            }
            else
            {
                sgMessage.SetTemplateId(((TemplateBody)deliveryItem.Body).TemplateName);
            }


            sgMessage.SetSandBoxMode(Settings.IsSandboxMode);


            await AddAttachmentStreamsAsync(sgMessage, deliveryItem.Attachments, token);

            var sgResponse = await SendToApiAsync(sgMessage, token);


            var isSuccess = sgResponse?.StatusCode == HttpStatusCode.Accepted ||
                            Settings.IsSandboxMode && sgResponse?.StatusCode == HttpStatusCode.OK;

            if (isSuccess)
            {
                return(sgResponse.Headers?.GetValues("X-Message-Id").FirstOrDefault());
            }

            throw new Exception(
                      $"Unable to deliver message; SendGrid response HTTP StatusCode is: {sgResponse?.StatusCode}");
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> PostDeliveryItems(List <DeliveryItemViewModel> deliveryItems,
                                                                Guid deliveryGuid)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            //create the orderitems and link them to the order
            foreach (var p in deliveryItems)
            {
                var deliveryItem = new DeliveryItem
                {
                    DeliveryItemDelivery  = await _db.Deliveries.FirstOrDefaultAsync(d => d.DeliveryGuid == deliveryGuid),
                    DeliveryItemGuid      = Guid.NewGuid(),
                    DeliveryItemOrderItem =
                        await _db.OrderItems.FirstOrDefaultAsync(oi => oi.OrderItemGuid == p.DeliveryItemOrderItem),
                    DeliveryItemQuantity = p.DeliveryItemQuantity
                };

                _db.DeliveryItems.Add(deliveryItem);
            }

            try
            {
                await _db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
            }

            return(CreatedAtRoute("DefaultApi", new { id = deliveryItems }, deliveryItems));
        }
Exemplo n.º 4
0
    public string SimpleRiddle_takethisto(DeliveryItem argDeliveryItem, int argCurfloor, int numberofWronsForThisSession)
    {
        string nameofGiver           = _hotelManager.GetCurFloorDweller().GEtMyName(true);
        string nameOfDestinationDude = argDeliveryItem.GetDestFloorDweller().AnimalName;
        string ItemNAme = argDeliveryItem.RefName;
        int    DestinationFloorNumber = argDeliveryItem.GetDestFloorDweller().MyFinalResidenceFloorNumber;
        int    RandomFloorDiscovered  = _hotelManager.Get_Random_FloorDiscovered();


        string strToSay = "";

        if (numberofWronsForThisSession == 0)
        {
            if (_hotelManager.DiscoveredFloors.Count <= 1)
            {
                //we jsut started
                strToSay = "a_" + Take_thisThing_to_FloorNumberRelativeToHere(ItemNAme, DestinationFloorNumber, argCurfloor);
            }
            else
            {
                strToSay = "b_" + Take_thisThing_to_FloorNumberRelativeToHere(ItemNAme, DestinationFloorNumber, argCurfloor);
            }
        }
        else
        if (numberofWronsForThisSession > 0 && numberofWronsForThisSession < 2)
        {
            strToSay = "c_" + Take_this_to_FloorNumberRelativeTo_Memorized(ItemNAme, DestinationFloorNumber, RandomFloorDiscovered);
        }
        else if (numberofWronsForThisSession >= 2)
        {
            strToSay = "d_" + Take_thisThing_to_FloorNumber(ItemNAme, argDeliveryItem.GetDestFloorDweller().MyFinalResidenceFloorNumber);
        }

        return(strToSay);
    }
        public IActionResult EditStatePost(DeliveryItem model, string filterJson)
        {
            ViewBag.filterJson = filterJson;
            var notification = notificationService.GetById <CaseNotification>(model.CaseNotificationId);

            if (model.DeliveryDateCC < model.RegDate?.Date)
            {
                ModelState.AddModelError(nameof(model.DeliveryDateCC), $"{MessageConstant.ValidationErrors.DeliveryDateBeforeRegDate} {model.RegDate?.ToString(FormattingConstant.NormalDateFormat)}");
            }
            if (model.DeliveryDateCC > DateTime.Now.AddMinutes(10))
            {
                ModelState.AddModelError(nameof(model.DeliveryDateCC), MessageConstant.ValidationErrors.DeliveryDateFuture);
            }
            if (!ModelState.IsValid)
            {
                SetViewbagState(notification?.NotificationDeliveryGroupId ?? -1);
                return(View(nameof(EditState), model));
            }

            if (service.DeliveryItemSaveState(model.Id, model.NotificationStateId, model.DeliveryDateCC, model.DeliveryInfo))
            {
                this.SaveLogOperation(false, model.Id);
                return(RedirectToAction(nameof(EditState), new { id = model.Id, filterJson }));
            }
            else
            {
                int filterType = getFilterTypeFromJson(filterJson);
                ViewBag.breadcrumbs = commonService.Breadcrumbs_ForDeliveryItemEditReturn(filterType, model.Id).DeleteOrDisableLast();
                SetViewbagState(notification?.NotificationDeliveryGroupId ?? -1);
                SetErrorMessage(MessageConstant.Values.SaveFailed);
                return(View(nameof(EditState), model));
            }
        }
 internal static EntityHistoryDeliveryItem ToEntityHistoryDeliveryItem(this DeliveryItem item,
                                                                       bool serializeAttachments)
 {
     return(new EntityHistoryDeliveryItem
     {
         SourceApplicationName = item.SourceApplicationName,
         HtmlContent = (item.Body as ContentBody)?.HtmlContent,
         TextContent = (item.Body as ContentBody)?.PlainTextContent,
         TemplateName = (item.Body as TemplateBody)?.TemplateName,
         SubstitutionsJson = JsonConvert.SerializeObject(item.Substitutions, Formatting.Indented),
         CreatedDate = item.CreatedDate,
         DeliveryProvider = item.DeliveryProvider,
         ExceptionMessage = item.ExceptionMessage,
         FromDisplayName = item.FromDisplayName,
         FromEmailAddress = item.FromEmailAddress,
         ReplyToDisplayName = item.ReplyToDisplayName,
         ReplyToEmailAddress = item.ReplyToEmailAddress,
         Id = item.Id,
         IsSuccess = item.IsSuccess,
         ProviderMessageId = item.ProviderMessageId,
         Subject = item.Subject,
         ToDisplayName = item.ToDisplayName,
         ToEmailAddress = item.ToEmailAddress,
         AttachmentsJson = GetHistoryAttachments(item.Attachments, serializeAttachments)
     });
 }
Exemplo n.º 7
0
 public void AttachItem(DeliveryItem argDeliveryItem, AnimalCharacterHands argLeftright)
 {
     if (!HasItem(argLeftright))
     {
         if (argLeftright == AnimalCharacterHands.Right)
         {
             _deliveryItem_R = argDeliveryItem;
             _deliveryItem_R.transform.position = new Vector3(RightHandHoldPos.position.x, RightHandHoldPos.position.y, RightHandHoldPos.position.z);
             _deliveryItem_R.transform.parent   = RightHandHoldPos.transform;
             if (isBellHopPlayer)
             {
                 BellHopGameEventManager.Instance.Call_DeliveryItemObtained(argDeliveryItem);
             }
         }
         else
         {
             _deliveryItem_L = argDeliveryItem;
             _deliveryItem_L.transform.position = new Vector3(LeftHandHoldPos.position.x, LeftHandHoldPos.position.y, LeftHandHoldPos.position.z);
             _deliveryItem_L.transform.parent   = LeftHandHoldPos.transform;
         }
     }
     else
     {
         Debug.Log("already child on " + argLeftright.ToString());
     }
 }
Exemplo n.º 8
0
        public IActionResult EditStatePost(DeliveryItem model, string filterJson)
        {
            ViewBag.filterJson = filterJson;
            var notification = notificationService.GetById <CaseNotification>(model.CaseNotificationId);

            if (!ModelState.IsValid)
            {
                SetViewbagState(notification?.NotificationDeliveryGroupId ?? -1);
                return(View(nameof(EditState), model));
            }

            if (service.DeliveryItemSaveState(model.Id, model.NotificationStateId, model.DeliveryDateCC))
            {
                this.SaveLogOperation(false, model.Id);
                return(RedirectToAction(nameof(EditState), new { id = model.Id, filterJson }));
            }
            else
            {
                int filterType = getFilterTypeFromJson(filterJson);
                ViewBag.breadcrumbs = commonService.Breadcrumbs_ForDeliveryItemEditReturn(filterType, model.Id).DeleteOrDisableLast();
                SetViewbagState(notification?.NotificationDeliveryGroupId ?? -1);
                SetErrorMessage(MessageConstant.Values.SaveFailed);
                return(View(nameof(EditState), model));
            }
        }
        /// <summary>
        ///     Gets the body for the message.
        /// </summary>
        /// <param name="builder">The builder.</param>
        /// <param name="message">The message.</param>
        /// <param name="settings">The settings.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="token">The cancellation token.</param>
        /// <returns>System.Threading.Tasks.Task&lt;MimeKit.BodyBuilder&gt;.</returns>
        public static async Task <BodyBuilder> GetMkBody(
            this BodyBuilder builder,
            DeliveryItem message,
            MkSmtpMailerSettings settings,
            ILogger logger,
            CancellationToken token = default(CancellationToken))
        {
            ContentBody cbody;

            if (message?.Body is TemplateBody body)
            {
                cbody = await body.GetContentBodyFromFileTemplatesAsync(
                    message,
                    settings.TemplateSettings.TemplatePath,
                    settings.TemplateSettings.HtmlTemplateFileExtensions,
                    settings.TemplateSettings.TextTemplateFileExtension,
                    logger,
                    token);
            }
            else
            {
                cbody = message?.Body as ContentBody;
            }

            return(builder.GetMimeEntityForContentBody(message, cbody));
        }
Exemplo n.º 10
0
        public DeliveryItem Create(Guid id, Guid deliveryId, Guid jobItemId, string notes)
        {
            if (!CurrentUser.HasRole(UserRole.Member))
            {
                throw new DomainValidationException(DeliveryItemMessages.InsufficientSecurityClearance, "CurrentUser");
            }
            if (id == Guid.Empty)
            {
                throw new ArgumentException("An ID must be supplied for the pending item.");
            }
            var deliveryItem = new DeliveryItem();

            deliveryItem.Id       = id;
            deliveryItem.ItemNo   = _deliveryRepository.GetDeliveryItemCount(deliveryId) + 1;
            deliveryItem.Delivery = GetDelivery(deliveryId);
            var jobItem = GetJobItem(jobItemId);

            deliveryItem.JobItem   = jobItem;
            deliveryItem.Notes     = notes;
            deliveryItem.QuoteItem = GetQuoteItem(jobItemId);
            ValidateAnnotatedObjectThrowOnFailure(deliveryItem);
            jobItem.Status = _listItemRepository.GetByType(ListItemType.StatusDeliveryNoteProduced);
            _jobItemRepository.EmitItemHistory(
                CurrentUser, jobItem.Id, 0, 0, "Item added to delivery note DR2000", ListItemType.StatusDeliveryNoteProduced, ListItemType.WorkTypeAdministration);
            _jobItemRepository.Update(jobItem);
            _deliveryItemRepository.Create(deliveryItem);
            return(deliveryItem);
        }
Exemplo n.º 11
0
        public async Task <IActionResult> addCart(List <Item> items, int shoppingMallId, int branchId, DateTime productLotDate, int carPlateId)
        {
            //check to seee if the items size >0
            if (items.Count > 0)
            {
                //create new cart object
                Delivery cart = new Delivery {
                    carPlateId     = carPlateId,
                    deliveryDate   = DateTime.Now,
                    productLotDate = productLotDate,
                    shoppingmallID = shoppingMallId,
                    branchId       = branchId,
                };

                //add cart into carts context
                _context.Delivery.Add(cart);

                //save change to the new cart
                //note thate when the new cart object is saved
                //the system will automatically assign the primary key(cartId) data for each cart data row
                await _context.SaveChangesAsync(); //save cart first

                //after the operation above, cart.cartId is accessible

                //create a list of cart items
                List <DeliveryItem> list1 = new List <DeliveryItem>();

                //loop throught each item in the items list
                foreach (Item item in items)
                {
                    //create a new object with the structure based on Model>CartItem.cs
                    var row = new DeliveryItem {
                        productId         = item.productId,
                        productName       = item.productName,
                        productQty        = item.productQty,
                        deliveryId        = cart.deliveryId, //cart Id go here
                        managerProductQty = item.productQty,
                    };
                    list1.Add(row);
                }//end loop

                //assign caritem list
                cart.deliveryItem = list1;
                await _context.SaveChangesAsync(); //save cart first

                //step33: return Action to be call by client
                return(Json(new
                {
                    newUrl = Url.Action("Index")
                }
                            ));
            }
            else
            {
                return(Content("error data upload fail"));
            }
        }
Exemplo n.º 12
0
    public void CreateSessionWhenBellHopObtainsANewItem(DeliveryItem argItem)
    {
        print("making new Session itenm dest is floor " + argItem.GetDestFloorDweller().MyFinalResidenceFloorNumber);
        DeliverySession temp = new DeliverySession(argItem, GameSessionID);

        curSession = temp;
        gameSessions.Add(temp);
        GameSessionID++;
    }
Exemplo n.º 13
0
        private void AddRow(DeliveryItem item)
        {
            DataRow row = this.Table.NewRow();

            row[0] = item.Comicstrip.ID;
            row[1] = item.Comicstrip.Titel;
            row[2] = item.Quantity;
            this.Table.Rows.Add(row);
        }
Exemplo n.º 14
0
        public string GetOrderNumber(DeliveryItem deliveryItem)
        {
            var quoteItem = deliveryItem.QuoteItem;

            if (quoteItem != null)
            {
                return(!String.IsNullOrEmpty(quoteItem.Quote.OrderNumber) ? quoteItem.Quote.OrderNumber : String.Empty);
            }
            return(!String.IsNullOrEmpty(deliveryItem.JobItem.Job.OrderNo) ? deliveryItem.JobItem.Job.OrderNo : String.Empty);
        }
Exemplo n.º 15
0
        public JsonResult GetDeliveryAreaId(DeliveryItem model)
        {
            var deliveryAreaFind = deliveryAreaAddressService.DeliveryAreaAddressFind(model?.Address);

            return(Json(new
            {
                deliveryAreaId = deliveryAreaFind.DeliveryAreaId,
                lawUnitId = deliveryAreaFind.LawUnitId
            }));
        }
Exemplo n.º 16
0
        public static DeliveryItem UpdateFields(this DeliveryItem existentDelivery, DeliveryItem newDelivery)
        {
            existentDelivery.ArticleID       = newDelivery.ArticleID;
            existentDelivery.Quantity        = newDelivery.Quantity;
            existentDelivery.UnitPrice       = newDelivery.UnitPrice;
            existentDelivery.GrossPrice      = newDelivery.GrossPrice;
            existentDelivery.Discount        = newDelivery.Discount;
            existentDelivery.DiscountedPrice = newDelivery.DiscountedPrice;

            return(existentDelivery);
        }
Exemplo n.º 17
0
        public JsonResult GetDeliveryAreaAndCourtForAddReceived(DeliveryItem deliveryItem)
        {
            var deliveryAreaFind = deliveryAreaAddressService.DeliveryAreaAddressFind(deliveryItem.Address);

            return(Json(new
            {
                toCourtId = deliveryAreaFind.ToCourtId,
                deliveryAreaId = deliveryAreaFind.DeliveryAreaId,
                lawUnitId = deliveryAreaFind.LawUnitId
            }));
        }
Exemplo n.º 18
0
 private void Edit(Guid deliveryItemId, string notes)
 {
     try
     {
         _deliveryItemForEdit = _deliveryItemService.Edit(deliveryItemId, notes);
     }
     catch (DomainValidationException dex)
     {
         _domainValidationException = dex;
     }
 }
Exemplo n.º 19
0
 private void CreateDeliveryItem(Guid id, Guid deliveryId, Guid jobItemId, string notes)
 {
     try
     {
         _savedDeliveryItem = _deliveryItemService.Create(id, deliveryId, jobItemId, notes);
     }
     catch (DomainValidationException dex)
     {
         _domainValidationException = dex;
     }
 }
Exemplo n.º 20
0
 string IsExists(DeliveryItem model)
 {
     if (model.Id <= 0)
     {
         var oldItem = service.GetDeliveryItemByRegNumber(model.RegNumber);
         if (oldItem != null)
         {
             return("Има такъв номер призовка");
         }
     }
     return("");
 }
Exemplo n.º 21
0
    // アイテム納品
    public void DeliExecution(string deliItemName, int deliItemQuantity)
    {
        UpdateDeliItems(deliItemName, deliItemQuantity, false);
        // 所持金・ポイントの更新
        DeliveryItem deliItem  = GetItemsCode(deliItemName);
        int          money     = deliItem.GetPrice() * deliItemQuantity;
        int          deliPoint = deliItem.GetDeliPoint() * deliItemQuantity;

        // 所持金とポイントの更新
        playerData.UpdPlayerMoney(money);
        playerData.UpdPlayerPoint(deliPoint);
    }
Exemplo n.º 22
0
        public void Put(int id, [FromBody] DeliveryItem newObj)
        {
            var oldObj = db.DeliveryItem.Find(id);

            if (oldObj == null)
            {
                return;
            }
            newObj.Id = oldObj.Id;
            db.Entry(oldObj).CurrentValues.SetValues(newObj);
            db.SaveChanges();
        }
Exemplo n.º 23
0
        public async Task <ActionResult <DeliveryItem> > PutDeliveryItem(long id, DeliveryItem delivery)
        {
            if (id != delivery.DeliveryId)
            {
                return(BadRequest());
            }

            _context.Entry(delivery).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(await _context.DeliveryItems.FindAsync(id));;
        }
Exemplo n.º 24
0
        private void FillItemCosts(DeliveryItem deliveryItem)
        {
            var onlineApiClient = ByDesignAPIHelper.CreateOnlineAPIClient();

            var getInventoryReturn = onlineApiClient.GetInventory_SingleItem(
                onlineApiClient.CreateCredentials(), "1", null, deliveryItem.ItemId, "Wholesale", 0).FirstOrDefault();

            if (getInventoryReturn != null)
            {
                deliveryItem.Cost    = Convert.ToDecimal(getInventoryReturn.Price);
                deliveryItem.PayCost = deliveryItem.Cost;
            }
        }
Exemplo n.º 25
0
        public IActionResult Update(string id, DeliveryItem deliveryIn)
        {
            var delivery = _deliveryService.Get(id);

            if (delivery == null)
            {
                return(NotFound());
            }

            _deliveryService.Update(id, deliveryIn);

            return(NoContent());
        }
Exemplo n.º 26
0
        public void UpdateDeliveryItem(DeliveryItem item)
        {
            var dbDi = Db.DeliveryItem.SingleOrDefault(di => di.DeliveryItem_Id == item.DeliveryItem_Id);

            dbDi.Intro     = item.Intro;
            dbDi.Name      = item.Name;
            dbDi.Project   = item.Project;
            dbDi.Quantity  = item.Quantity;
            dbDi.Remark    = item.Remark;
            dbDi.Spec      = item.Spec;
            dbDi.Unit      = item.Unit;
            dbDi.UnitPrice = item.UnitPrice;
        }
Exemplo n.º 27
0
    public void MoveTO(DeliveryItem argItem, Transform startMarker, Transform endMarker)
    {
        // if (argItem.transform.parent != null)
        //  {
        argItem.transform.parent = null;
        // }

        journeyLength = 10000000;
        startTime     = Time.time;
        journeyLength = Vector3.Distance(startMarker.position, endMarker.position);

        // StartCoroutine(MoveCurItemRoutine(startMarker, endMarker, argItem));
        StartCoroutine(Parabola(startMarker, endMarker, argItem, 0.6f, 0.5f));
    }
Exemplo n.º 28
0
    IEnumerator Curve(Transform startMarker, Transform endMarker, DeliveryItem argItem, float height, float duration)
    {
        Vector3 startPos       = startMarker.position;
        Vector3 endPos         = startMarker.position;;
        float   normalizedTime = 0.0f;

        while (normalizedTime < 1.0f)
        {
            float yOffset = m_Curve.Evaluate(normalizedTime);
            argItem.transform.position = Vector3.Lerp(startPos, endPos, normalizedTime) + yOffset * Vector3.up;
            normalizedTime            += Time.deltaTime / duration;
            yield return(null);
        }
    }
Exemplo n.º 29
0
 public void Setup()
 {
     _userContext = TestUserContext.Create("*****@*****.**", "Graham Robertson", "Operations Manager", UserRole.Manager | UserRole.Member);
     _domainValidationException = null;
     _savedPendingItem          = null;
     _savedDeliveryItem         = null;
     _jobItemService            = null;
     _deliveryItemService       = null;
     _jobItemToUpdateId         = Guid.NewGuid();
     _jobItemToUpdate           = new JobItem
     {
         Id  = _jobItemToUpdateId,
         Job = new Job
         {
             Id          = Guid.NewGuid(),
             JobNo       = "JR2000",
             CreatedBy   = _userContext.GetCurrentUser(),
             OrderNo     = "ORDER12345",
             DateCreated = DateTime.UtcNow,
             Customer    = new Customer {
                 Id = Guid.NewGuid(), Name = "Gael Ltd"
             }
         },
         ItemNo     = 1,
         SerialNo   = "12345",
         Instrument = new Instrument
         {
             Id           = Guid.NewGuid(),
             Manufacturer = "Druck",
             ModelNo      = "DPI601IS",
             Range        = "None",
             Description  = "Digital Pressure Indicator"
         },
         CalPeriod   = 12,
         Created     = DateTime.UtcNow,
         CreatedUser = _userContext.GetCurrentUser(),
     };
     _deliveryItemForEditId = Guid.NewGuid();
     _deliveryItemForEdit   = new DeliveryItem
     {
         Id       = _deliveryItemForEditId,
         Delivery = new Delivery {
             Id = Guid.NewGuid(), DeliveryNoteNumber = "DR2000", Customer = new Customer {
                 Id = Guid.NewGuid(), Name = "Gael"
             }
         },
         ItemNo = 1,
     };
 }
Exemplo n.º 30
0
        private static void Main(string[] args)
        {
            while (true)
            {
                Console.Write("Enter Weight in kg: ");
                var weight = Console.ReadLine();

                if (string.IsNullOrWhiteSpace(weight))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Height in cm: ");
                var height = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(height))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Width in cm: ");
                var width = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(width))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Depth: ");
                var depth = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(depth))
                {
                    Console.Clear();
                    continue;
                }

                Console.WriteLine("-------------------------");

                var box      = new ProductBox(depth.ChangeType <int>(), height.ChangeType <int>(), width.ChangeType <int>());
                var delivery = new DeliveryItem(box, weight.ChangeType <double>());

                delivery.Print();

                Console.ReadKey();
                Console.Clear();
                Thread.Sleep(1000);
            }
        }
Exemplo n.º 31
0
        void SetMissionDirector()
        {
            var newDirector = GameObject.Instantiate ( missionDirectorPref , container.transform   ) as GameObject;
            newDirector.transform.localPosition = Vector3.zero;

            missionDirector = newDirector.GetComponent<Director>();

            deliveryItem = FindObjectOfType<DeliveryItem>();

            if (deliveryItem == null) {
                print ("no delivery item found");
                return;
            }

            deliveryItem.OnHoldingUpdated += UpdateMissionDirector;

            UpdateMissionDirector ();
        }