예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.ValidateChildren())
            {
                myJuve.BirthDate     = Convert.ToDateTime(dtpBirthDate.Text);
                myJuve.FirstName     = txtFirstName.Text;
                myJuve.MiddleInitial = txtMidInit.Text;
                myJuve.LastName      = txtLastName.Text;
                myJuve.AdultMemberID = Convert.ToInt16(txtAdultMemberID.Text);

                try
                {
                    myDb.AddMember(myJuve);
                    frmMemberInfo memberInfo = new frmMemberInfo((Member)myJuve);
                    memberInfo.MdiParent = this.MdiParent;
                    memberInfo.Show();
                    this.Close();
                }
                catch (LibraryException)
                {
                    string myErr = string.Format("Add Juvenile Failed");
                    tsslStatusLabel.Text = myErr;
                    return;
                }
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: Emtey/BootCamp
        private void getMemberInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //create a new member info panel, set its parent to form1 (this)
            //and open the bad boy!
            Form memberInfo = new frmMemberInfo();

            memberInfo.MdiParent = this;
            memberInfo.Show();
        }
예제 #3
0
파일: Form1.cs 프로젝트: Emtey/BootCamp
        /// <summary>
        /// Main form that is displayed.
        /// </summary>
        public frmMain()
        {
            InitializeComponent();
            arrangeIconsToolStripMenuItem.Enabled = false;
            arrangeIconsToolStripMenuItem.Visible = false;
            //center on the screen.
            CenterToScreen();
            //open the member info panel on load.
            Form memberInfo = new frmMemberInfo();

            memberInfo.MdiParent = this;
            memberInfo.Show();
        }
예제 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.ValidateChildren())
            {
                myAdult.FirstName     = txtFirstName.Text;
                myAdult.MiddleInitial = txtMidInit.Text;
                myAdult.LastName      = txtLastName.Text;
                myAdult.Street        = txtStreet.Text;
                myAdult.City          = txtCity.Text;
                myAdult.State         = cbState.Text;
                myAdult.ZipCode       = txtZip.Text;
                myAdult.PhoneNumber   = txtPhone.Text;

                try
                {
                    myDb.AddMember(myAdult);
                    frmMemberInfo memberInfo = new frmMemberInfo((Member)myAdult);
                    memberInfo.MdiParent = this.MdiParent;
                    memberInfo.Show();
                    this.Close();
                }
                catch (LibraryException ex)
                {
                    if (ex.LibraryErrorCode == ErrorCode.AddAdultFailed)
                    {
                        string myErr = string.Format("Add Adult Failed");
                        tsslLabel.Text = myErr;
                        return;
                    }
                    if (ex.LibraryErrorCode == ErrorCode.GenericException)
                    {
                        tsslLabel.Text = "ERROR: " + ex.Message;
                        return;
                    }
                }
            }
        }