Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtParticipantCount.Text))
            {
                MessageBox.Show("Error: Participant count string cannot be blank");
                return;
            }
            else
            {
                try
                {
                    CurrentPlanParticipantsActive.ParticipantCount = int.Parse(txtParticipantCount.Text);
                }
                catch
                {
                    MessageBox.Show("Error: Participant count string not in integer format");
                    return;
                }
            }

            if (String.IsNullOrWhiteSpace(txtAsOfDate.Text))
            {
                MessageBox.Show("Error: As of date string cannot be blank");
                return;
            }
            else
            {
                try
                {
                    CurrentPlanParticipantsActive.AsOfDate = DateTime.Parse(txtAsOfDate.Text);
                }
                catch
                {
                    MessageBox.Show("Error: As Of Date string not in date format");
                    return;
                }
            }

            CurrentPlanParticipantsActive.SaveRecordToDatabase(frmMain_Parent.CurrentUser.UserId);
            //this.Close();
        }