コード例 #1
0
ファイル: frmMain.cs プロジェクト: destinnie-laila/NZToursApp
        //========== Usecase Delete a Tour================//

        private void btnDelete_Click(object sender, EventArgs e)
        {
            {
                clsTour lcTour = (clsTour)lstTour.SelectedItem;
                ClsTourCompany.TourList.Remove(lcTour.ID.ToString());
                if (lcTour != null && MessageBox.Show("This Tour will be permanantly deleted, would you like to continue?", "Delete Tour", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    updateDisplay();
                }
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: destinnie-laila/NZToursApp
        //========================Edit a tour===========================//

        private void EditTour()

        {
            clsTour lcTour = (clsTour)lstTour.SelectedItem;

            if (lcTour != null &&

                lcTour.ViewEdit())

            {
                updateDisplay();
            }
        }
コード例 #3
0
ファイル: frmMain.cs プロジェクト: destinnie-laila/NZToursApp
        //============ Add a Tour - Tutorial 2 ==================//
        private void btnAdd_Click(object sender, EventArgs e)

        {
            clsTour lcTour = new clsTour();

            if (lcTour != null && lcTour.ViewEdit())



            {
                ClsTourCompany.TourList.Add(lcTour.ID, lcTour);

                updateDisplay();
            }
        }
コード例 #4
0
        public bool ShowDialog(clsTour prTour)

        {
            _Tour = prTour;

            _TempTour.CostList.Clear();//make sure empty

            foreach (clsCost cost in _Tour.CostList)
            {
                _TempTour.CostList.Add(cost);
            }


            updateDisplay();
            return(ShowDialog() == DialogResult.OK);
        }
コード例 #5
0
 //Cost Per kilometre from overriden Inputammount X Distance in ClsTour
 public override decimal amount(clsTour prTour)
 {
     return(InputAmmount * prTour.Distance);
 }