示例#1
0
        /// <summary>
        /// Adds a new delivery for a material
        /// </summary>
        /// <param name="materialIndex">index of material in materials list</param>
        public void NewDelivery(int materialIndex)
        {
            Views.DeliveryView view = new Views.DeliveryView();
            view.Show();

            view.SetController(this);
            view.SetMaterial(materialIndex, materials[materialIndex].Name);
        }
示例#2
0
        /// <summary>
        /// Updates a deliveries information
        /// </summary>
        /// <param name="materialIndex">index of material in materials list</param>
        /// <param name="deliveryIndex">index of delivery in deliveries list</param>
        public void UpdateDelivery(int materialIndex, int deliveryIndex)
        {
            Material material = materials[materialIndex];
            Dictionary <string, string> delivery = new Dictionary <string, string>();

            delivery.Add("DeliveryDate", material.Deliveries[deliveryIndex].DeliveryDate.ToString());
            delivery.Add("Quantity", material.Deliveries[deliveryIndex].Quantity.ToString());

            Views.DeliveryView view = new Views.DeliveryView();
            view.Show();

            view.SetController(this);
            view.SetMaterial(materialIndex, material.Name);
            view.SetDelivery(deliveryIndex, delivery);
        }