Esempio n. 1
0
        /// <summary>
        /// Insert the owner info into the database
        /// </summary>
        private void InsertOwner()
        {
            string sql          = $@"INSERT INTO Owners
	                            (FirstName, MiddleName, LastName, DOB, DateOfRetirement, Retired)
	                            VALUES
	                            ('{fName}', {mName}, '{lName}', '{dob}', {dateOfRetirement}, {isRetired});"    ;
            int    rowsAffected = DatabaseHelper.SendData(sql);

            UIMethods.DisplayStatusMessage(((frmMDIParent)MdiParent).GetStatusLabel(), $"{rowsAffected} row(s) added");
            UIMethods.ClearControls(Controls);
            ((frmMDIParent)MdiParent).ReloadAllChildForms();
        }
Esempio n. 2
0
        /// <summary>
        /// Insert the breed info into the database
        /// </summary>
        private void AddBreed()
        {
            string sql          = $@"
                        INSERT INTO Breeds
	                        (Breed, PrimaryCoatColour, SecondaryCoatColour, [Classification])
	                        Values
	                        ('{breedName}', {primaryId}, {secondaryId}, {classId});"    ;
            int    rowsAffected = DatabaseHelper.SendData(sql);

            UIMethods.DisplayStatusMessage(((frmMDIParent)MdiParent).GetStatusLabel(), $"{rowsAffected} row(s) added");
            UIMethods.ClearControls(Controls);
            ((frmMDIParent)MdiParent).ReloadAllChildForms();
        }
Esempio n. 3
0
        /// <summary>
        /// Insert dog info into database
        /// </summary>
        private void InsertDog()
        {
            string sql          = $@"INSERT INTO Dogs
	                            ([Name], Sex, [Weight], Height, DOB, DateOfRetirement, Retired, DateOfChampionship, 
                                Champion, DateOfDisqualification, PermanentlyDisqualified, Breed)
	                            VALUES
	                            ('{name}', {sex}, {weight}, {height}, '{dob}', {dateRetired}, {retired}, 
                                {dateChampionship}, {champion}, {dateBanned}, {banned}, {breedId});";
            int    rowsAffected = DatabaseHelper.SendData(sql);

            UIMethods.DisplayStatusMessage(((frmMDIParent)MdiParent).GetStatusLabel(), $"{rowsAffected} row(s) added");
            UIMethods.ClearControls(Controls);
            rdoMale.Checked = true;
            ((frmMDIParent)MdiParent).ReloadAllChildForms();
        }
 private void btnReset_Click(object sender, EventArgs e)
 {
     UIMethods.ClearControls(Controls);
     rdoSexEither.Checked = true;
     Reload();
 }