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(); } } }
public AddEditPackage(ManagePackagesListing managePackagesListing = null) { InitializeComponent(); lblTitle.Text = "Add New Package"; this.Text = "Add New Package"; isEditMode = false; _managePackagesListing = managePackagesListing; _db = new TravelExpertsEntities(); }
//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(); }
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); } }
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); } }
public ManagePackagesListing() { InitializeComponent(); _db = new TravelExpertsEntities(); }
public ManageSupplierListing() { InitializeComponent(); _db = new TravelExpertsEntities(); }