Beispiel #1
0
        public DialogResult ShowDialog(ClsCost prCost)

        {
            _Cost = prCost;
            updateDisplay();
            return(ShowDialog());
        }
Beispiel #2
0
        private void EditTourCostDetails()
        {
            ClsCost lcCost = (ClsCost)listViewTourCost.FocusedItem.Tag;

            if (lcCost != null && lcCost.ViewEdit())
            {
                UpdateCostListDisplayAndCostTotal();
                CalculatePricePerPassenger();
            }
        }
Beispiel #3
0
        private void btnAddTourCost_Click(object sender, EventArgs e)
        {
            var     TourData   = getTourDataForCostAmountCalculation();
            ClsCost lcTourCost = ClsCost.NewCost(comboBoxCostType.SelectedIndex, TourData);

            if (lcTourCost != null && lcTourCost.ViewEdit())
            {
                _Tour.TourCostList.Add(lcTourCost.ID, lcTourCost);
                UpdateCostListDisplayAndCostTotal();
                CalculatePricePerPassenger();
            }
        }
Beispiel #4
0
        private void btnDeleteTourCost_Click(object sender, EventArgs e)
        {
            ClsCost lcCost = (ClsCost)listViewTourCost.FocusedItem.Tag;

            if (lcCost != null)
            {
                DialogResult result = MessageBox.Show("Are you sure to Delete ?", "Alert", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    _Tour.TourCostList.Remove(lcCost.ID);
                    UpdateCostListDisplayAndCostTotal();
                    CalculatePricePerPassenger();
                }
            }
        }
Beispiel #5
0
        private void UpdateCostListDisplayAndCostTotal()
        {
            decimal TotalCost = 0;

            listViewTourCost.Items.Clear();
            List <ClsCost> tourCostDetails = _Tour.TourCostList.Values.ToList <ClsCost>();

            foreach (var ClsCost in tourCostDetails)
            {
                ListViewItem cost = new ListViewItem();
                cost.Text = ClsCost.Name;
                cost.SubItems.Add(ClsCost.typeOfCost());
                cost.SubItems.Add("$" + ClsCost.Cost.ToString());
                cost.Tag = ClsCost;
                listViewTourCost.Items.Add(cost);
                TotalCost += ClsCost.Cost;
            }
            lblTotalCost.Text = Convert.ToString(TotalCost);
        }