示例#1
0
        public AddEditPackage(Package package = null, ManagePackageListing managePackageListing = null)
        {
            InitializeComponent();
            _db = new TravelExpertsEntities();

            _managePackageListing = managePackageListing;

            packageTemp = package;
            if (package != null)
            {
                txtPackageName.Text = package.PkgName;
                txtDescription.Text = package.PkgDesc;

                if (package.PkgStartDate.HasValue)
                {
                    dtpStartDate.Value = package.PkgStartDate.Value;
                }

                if (package.PkgEndDate.HasValue)
                {
                    dtpEndDate.Value = package.PkgEndDate.Value;
                }

                txtBasicPrice.Text = package.PkgBasePrice.ToString();

                if (package.PkgAgencyCommission.HasValue)
                {
                    txtAgencyCommision.Text = package.PkgAgencyCommission.Value.ToString();
                }
            }
        }
示例#2
0
 public AddEditPackage(ManagePackagesListing managePackagesListing = null)
 {
     InitializeComponent();
     lblTitle.Text          = "Add New Package";
     this.Text              = "Add New Package";
     isEditMode             = false;
     _managePackagesListing = managePackagesListing;
     _db = new TravelExpertsEntities();
 }
示例#3
0
 //Using same window form for Add Edit. Titles will be different depending on if it was add or edit
 public AddEditSupplier(ManageSupplierListing manageSupplierListing = null)
 {
     InitializeComponent();
     lblSupTitle.Text       = "Add New Supplier";
     this.Text              = "Add New Supplier";
     isEditMode             = false;
     _manageSupplierListing = manageSupplierListing;
     _db = new TravelExpertsEntities();
 }
示例#4
0
        public AddEditPackage(Package packageToEdit, ManagePackagesListing managePackagesListing = null)
        {
            InitializeComponent();
            lblTitle.Text          = "Edit Packages";
            this.Text              = "Edit Packages";
            _managePackagesListing = managePackagesListing;

            if (packageToEdit == null)
            {
                MessageBox.Show("Please ensure you selected a valid Package to edit");
                Close();
            }
            else
            {
                isEditMode = true;
                _db        = new TravelExpertsEntities();
                PopulateFields(packageToEdit);
            }
        }
示例#5
0
        public AddEditSupplier(Supplier supplierToEdit, ManageSupplierListing manageSupplierListing = null)
        {
            InitializeComponent();
            lblSupTitle.Text       = "Edit Suppliers";
            this.Text              = "Edit Suppliers";
            _manageSupplierListing = manageSupplierListing;

            if (supplierToEdit == null)
            {
                MessageBox.Show("Please ensure you selected a valid Supplier to edit");
                Close();
            }
            else
            {
                isEditMode = true;
                _db        = new TravelExpertsEntities();
                PopulateFields(supplierToEdit);
            }
        }
        public AddEditProduct(Product productToEdit, ManageProductListing manageProductListing = null)
        {
            InitializeComponent();
            lblTitle.Text         = "Edit Products";
            this.Text             = "Edit Products";
            _manageProductListing = manageProductListing;

            //Validation
            if (productToEdit == null)
            {
                MessageBox.Show("Please ensure you selected a valid Product to edit");
                Close();
            }
            else
            {
                isEditMode = true;
                _db        = new TravelExpertsEntities();
                PopulateFields(productToEdit);
            }
        }
示例#7
0
 public ManagePackagesListing()
 {
     InitializeComponent();
     _db = new TravelExpertsEntities();
 }
示例#8
0
 public ManageSupplierListing()
 {
     InitializeComponent();
     _db = new TravelExpertsEntities();
 }