Beispiel #1
0
        private void DisplayHireCost()
        {
            if (_Vehicle.ActivityList != null)
            {
                int count = 0;
                foreach (ClsActivity lcActivity in _Vehicle.ActivityList)
                {
                    switch (lcActivity.TypeOfActivity())
                    {
                    case "Hire":
                        ClsHire hire = (ClsHire)_Vehicle.ActivityList[count];
                        hire.Value = hire.CalculateValue(_Vehicle.DailyHireCharge);

                        break;

                    case "Relocate":
                        ClsRelocate relocate = (ClsRelocate )_Vehicle.ActivityList[count];
                        relocate.Value = relocate.CalculateValue(lcActivity.Value);
                        break;

                    default:
                        ClsService service = (ClsService)_Vehicle.ActivityList[count];
                        service.Value = service.CalculateValue(lcActivity.Value);
                        break;
                    }

                    count++;
                }
            }
        }
Beispiel #2
0
        protected override void PushData()
        {
            base.PushData();
            ClsHire lcActivity = (ClsHire)_Activity;

            lcActivity.EndDate  = dtpEndDate.Value;
            lcActivity.CustName = txtCustomer.Text;
        }
Beispiel #3
0
        protected override void UpdateDisplay()
        {
            base.UpdateDisplay();
            ClsHire lcActivity = (ClsHire)_Activity;

            txtCustomer.Text = lcActivity.CustName;
            dtpEndDate.Value = lcActivity.EndDate;
        }
Beispiel #4
0
        protected override void btnOK_Click(object sender, EventArgs e)
        {
            PushData();
            ClsHire lcActivity = (ClsHire)_Activity;

            if (txtCustomer.Text != "" && txtName.Text != "")
            {
                if (lcActivity.EndDate.CompareTo(lcActivity.Date) >= 0) //<0:instance earlier than value. 0:instance same as value. 0<:instance later than value.
                {
                    base.btnOK_Click(sender, e);
                }
                else
                {
                    MessageBox.Show("Startdate must be before Enddate", "Invalide Dates");
                }
            }
            else
            {
                MessageBox.Show("A Least one Field is empty. Please insert missing Data", "Field Empty");
            }
        }