Ejemplo n.º 1
0
        private bool BeforSave()
        {
            bool b;

            b  = FormChecker.CheckEmpty(txtCompanyName, lblCompanyName);
            b  = FormChecker.CheckEmpty(txtTel, lblTel);
            b &= FormChecker.CheckEmpty(txtAddress, lblAddress);
            return(b);
        }
Ejemplo n.º 2
0
        private bool BeforSave()
        {
            bool b;

            b  = FormChecker.CheckEmpty(txtAgentName, lblAgentName);
            b &= FormChecker.CheckEmpty(txtTelephone, lblTel);
            //b &= FormChecker.CheckEmpty(txtAddress, lblAddress);
            return(b);
        }
Ejemplo n.º 3
0
        private bool BeforSave()
        {
            bool b;

            b  = FormChecker.CheckDate(txtDate, lblDate);
            b &= FormChecker.CheckEmpty(txtNumber, lblNumber);

            return(b);
        }
Ejemplo n.º 4
0
        private bool checkData()
        {
            bool b;

            b  = FormChecker.CheckEmpty(txtRecievePattern, lblRecievePattern);
            b &= FormChecker.CheckEmpty(txtSendPattern, lblSendPattern);

            b &= checkYearTandem(txtRecievePattern.Text);
            b &= checkMonthTandem(txtRecievePattern.Text);
            b &= checkDayTandem(txtRecievePattern.Text);

            b &= checkYearTandem(txtSendPattern.Text);
            b &= checkMonthTandem(txtSendPattern.Text);
            b &= checkDayTandem(txtSendPattern.Text);

            b &= checkNumberSignsTandem(txtRecievePattern.Text);
            int n1 = _NumberSignCount;

            b &= checkNumberSignsTandem(txtSendPattern.Text);
            int n2 = _NumberSignCount;

            if (n1 != txtLastNumbeRecieve.Text.Length)
            {
                MessageBox.Show("لطفا تعداد ارقام برای آخرین شماره نامه  تولیده شده وارده را به تعداد ارقام انتخابی وارد نمایید،");
                return(false);
            }
            if (n2 != txtLastNumbeSend.Text.Length)
            {
                MessageBox.Show("لطفا تعداد ارقام برای آخرین شماره نامه  تولیده شده صادره را به تعداد ارقام انتخابی وارد نمایید،");
                return(false);
            }

            if (!b)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 5
0
        private bool BeforSave()
        {
            bool b;

            b  = FormChecker.CheckEmpty(txtRecieptBillNumber, lblRecieptBillNumber);
            b &= FormChecker.CheckDate(txtIssueDate, lblIssueDate);
            b &= FormChecker.CheckEmpty(txtPrice, lblPrice);

            try
            {
                if (txtPrice.Text.Length > 0)
                {
                    int i = int.Parse(txtPrice.Text);
                    lblPrice.ForeColor = Color.Red;
                }
            }
            catch (Exception ex)
            {
                b &= false;
                lblPrice.ForeColor = Color.Red;
            }

            return(b);
        }
Ejemplo n.º 6
0
        private bool BeforSave()
        {
            bool b;

            lblAccountHolderName.ForeColor = Color.Black;
            lblAccountNumber.ForeColor     = Color.Black;
            lblBankName.ForeColor          = Color.Black;
            lblChequeNumber.ForeColor      = Color.Black;
            //lblChqueReply.ForeColor = Color.Black;
            //lblDescription.ForeColor = Color.Black;
            lblDescription2.ForeColor    = Color.Black;
            lblEntryDate.ForeColor       = Color.Black;
            lblInsuranceNumber.ForeColor = Color.Black;
            lblIssueDate.ForeColor       = Color.Black;
            lblMaturityDate.ForeColor    = Color.Black;
            lblPayType.ForeColor         = Color.Black;

            b  = FormChecker.CheckEmpty(cmbPayType, lblPayType);
            b &= FormChecker.CheckEmpty(cmbInsuranceCompany, lblInsuranceCompany);

/*            b &= FormChecker.CheckEmpty(txtCompany, lblCompany);
 *          if (txtCompany.Tag == null || ((int)txtCompany.Tag) <= 0)
 *          {
 *              b &= false;
 *              lblCompany.ForeColor = Color.Red;
 *          }
 *          else
 *              lblCompany.ForeColor = Color.Black;
 */
            if (_id < 0)
            {
                b &= FormChecker.CheckEmpty(cmbReferenceUserId, lblReferenceUserId);
            }

            if (cmbPayType.SelectedIndex == 0)
            {
                b &= FormChecker.CheckEmpty(txtChequeNumber, lblChequeNumber);
                b &= FormChecker.CheckDate(txtMaturityDate, lblMaturityDate);
                b &= FormChecker.CheckEmpty(txtPrice, lblPrice);
                b &= FormChecker.CheckEmpty(cmbBankId, lblBankName);
                b &= FormChecker.CheckEmpty(txtAccountNumber, lblAccountNumber);
                b &= FormChecker.CheckEmpty(txtAccountHolderName, lblAccountHolderName);
                b &= FormChecker.CheckEmpty(txtInsuranceNumber, lblInsuranceNumber);
            }
            else if (cmbPayType.SelectedIndex == 1)
            {
                b &= FormChecker.CheckEmpty(txtPrice, lblPrice);
                b &= FormChecker.CheckEmpty(txtInsuranceNumber, lblInsuranceNumber);
            }

            try
            {
                if (txtPrice.Text.Length > 0)
                {
                    int i = int.Parse(txtPrice.Text);
                    lblPrice.ForeColor = Color.Black;
                }
            }
            catch (Exception ex)
            {
                b &= false;
                lblPrice.ForeColor = Color.Red;
            }

            return(b);
        }