Esempio n. 1
0
        /// <summary>
        /// Add a package to the database.
        /// </summary>
        public void AddPackageToGrid()
        {
            message = "ADD";
            ManagePackage addPackage = new ManagePackage(message, this);

            addPackage.ShowDialog();
        }
Esempio n. 2
0
        /// <summary>
        /// Edit a package.
        /// </summary>
        public void EditPackage()
        {
            // Set message to Edit
            message = "EDIT";

            // Create package form and set it to edit
            Package packageToBeEdited = DataConnectionClass.DataLists.Packages.FirstOrDefault(pid => pid.PackageId == Convert.ToInt64(dataGridPackages.SelectedRows[0].Cells[0].Value));

            if (!(packageToBeEdited is null))
            {
                ManagePackage addPackage = new ManagePackage(message, packageToBeEdited, this);
                addPackage.ShowDialog();
            }