コード例 #1
0
        private void btnViewTrans_Click(object sender, EventArgs e)
        {
            PastTransactions pt = new PastTransactions();

            if (rbtnAll.Checked == true)
            {
                pt.viewAllTrans = true;
                pt.viewbtnTrans = true;
            }
            else
            {
                transID         = txtTid.Text;
                pt.viewbtnTrans = true;
                pt.viewAllTrans = false;
            }
            pt.ShowDialog();
        }
コード例 #2
0
        private void btnView_Click(object sender, EventArgs e)
        {
            #region Checking error of selection
            if (chkbDateFrom.Checked == false && chkbFacilities.Checked == false && chkbStatus.Checked == false)
            {
                error = true;
                msgBox();
            }
            else
            {
                if (chkbFacilities.Checked)
                {
                    if (cmbFac.Text == "")
                    {
                        error = true;
                        msgBox();
                    }
                    else
                    {
                        Fac = cmbFac.Text;
                    }
                }

                if (chkbStatus.Checked)
                {
                    if (cmbStatus.Text == "")
                    {
                        error = true;
                        msgBox();
                    }
                    else
                    {
                        Status = cmbStatus.Text;
                    }
                }

                if (chkbDateFrom.Checked)
                {
                    // Cannot work if you put same date... WHY !!?!?
                    if (dtpDateFromML.Value < dtpDatetoML.Value || dtpDateFromML.Value.ToString("yyyy/MM/dd") == dtpDatetoML.Value.ToString("yyyy/MM/dd"))
                    {
                        Datefrom = dtpDateFromML.Value;
                        Dateto   = dtpDatetoML.Value;
                        lblWarningMLDateTo.Visible = false;
                    }
                    else
                    {
                        error = true;
                        msgBox();
                        lblWarningMLDateTo.Visible = true;
                    }
                }
            }
            #endregion

            #region Passing values to new form / reset boolean
            if (error == false)
            {
                PastTransactions pt = new PastTransactions();
                pt.getFlagfac    = chkbFacilities.Checked;
                pt.getFlagdate   = chkbDateFrom.Checked;
                pt.getFlagstatus = chkbStatus.Checked;
                pt.viewbtnTrans  = false;
                pt.ShowDialog();
            }

            // Reset to false for new search
            error  = false;
            msgbox = false;
            #endregion
        }