/// <summary>
        /// This function initiate order and send to the planner for further process
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateOrder_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(ClientName.Text) || !string.IsNullOrEmpty(txtDestinationCity.Text) || !string.IsNullOrEmpty(txtOriginCity.Text) || !string.IsNullOrEmpty(JobType.Text) || !string.IsNullOrEmpty(vanType.Text))
            {
                TMS.Data.City city = (TMS.Data.City)Enum.Parse(typeof(TMS.Data.City), txtDestinationCity.Text);
                contract.Destination   = city;
                contract.Customer      = new Customer();
                contract.Customer.Name = ClientName.Text;
                tms.CreateCustomer(contract.Customer);
                city            = (TMS.Data.City)Enum.Parse(typeof(TMS.Data.City), txtOriginCity.Text);
                contract.Origin = city;
                JobType job = (JobType)Enum.Parse(typeof(JobType), JobType.Text);
                contract.JobType = job;
                VanType van = (VanType)Enum.Parse(typeof(VanType), vanType.Text);
                contract.VanType  = van;
                contract.Quantity = Convert.ToInt32(Quantity.Text);

                TMS.Data.Status status = (TMS.Data.Status)Enum.Parse(typeof(TMS.Data.Status), Status.PENDING.ToString());

                contract.Status = status;
                tms.CreateContract(contract);
                MessageBox.Show("Order Started", "Done", MessageBoxButton.OK, MessageBoxImage.Information);
                MakeFileEmpty();

                Invoice.GenerateInvoice(contract);
            }
            else
            {
                MessageBox.Show("Please Select an order first !!", "Empty Selection", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 2
0
        public static VanType GetVanType(string van)
        {
            try
            {
                VanType t = new VanType();
                t = VanType.NONE;

                switch (van.ToUpper())
                {
                case "KICC":
                    t = VanType.KICC;
                    break;

                case "KSNET":
                    t = VanType.KSNET;
                    break;

                case "KIS":
                    t = VanType.KIS;
                    break;

                case "STAR_CAT":
                    t = VanType.STAR_CAT;

                    break;
                }

                return(t);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 public Van(string model, string make, VanType type, int price, int year, int mile, double size, WheelBase wheel, string des,
            string color, string socure, string img) : base(model, make, price, year, mile, size, des, color, socure, img)
 {
     BodyType  = type;
     Wheelbase = wheel;
 }
Ejemplo n.º 4
0
 public Van(string make, string model, decimal price, int year, string color, decimal mileage, string description, BitmapImage image, VanType vanType, Wheelbase wheelBase) : base(make, model, price, year, color, mileage, description, image)
 {
     this.type  = vanType;
     this.wBase = wheelBase;
 }