예제 #1
0
        private void ButtonProcess_Click(object sender, EventArgs e)
        {
            if (textBoxEmpID.Text == "" || textBoxAmount.Text == "" || textBoxInstallment.Text == "")
            {
                MessageBox.Show("Fields cannot be empty");
            }
            else if (dateTimePicker1.Value.ToShortDateString() == dateTimePicker2.Value.ToShortDateString())
            {
                MessageBox.Show("Start Date and End Date Cannot be the same");
            }
            else if (dateTimePicker2.Value.Month < dateTimePicker1.Value.Month)
            {
                MessageBox.Show("End Date Cannot be a Back month than Start Date");
            }
            else if (dateTimePicker2.Value.Day < dateTimePicker1.Value.Day)
            {
                MessageBox.Show("End Date Cannot be a Back date than Start Date");
            }
            else
            {
                loan.EmpID = Int32.Parse(textBoxEmpID.Text);

                empID       = textBoxEmpID.Text;
                loanAmount  = textBoxAmount.Text;
                installment = textBoxInstallment.Text;
                startDate   = dateTimePicker1.Value;
                endDate     = dateTimePicker2.Value;

                FormLoanConfirm formLoanConfirm = new FormLoanConfirm();
                formLoanConfirm.Show();
            }
        }
예제 #2
0
        private void ButtonProcess_Click(object sender, EventArgs e)
        {
            loan.EmpID = Int32.Parse(textBoxEmpID.Text);

            empID       = textBoxEmpID.Text;
            loanAmount  = textBoxAmount.Text;
            installment = textBoxInstallment.Text;
            startDate   = dateTimePicker1.Value;
            endDate     = dateTimePicker2.Value;

            FormLoanConfirm formLoanConfirm = new FormLoanConfirm();

            formLoanConfirm.Show();
        }