private bool BeforSave() { bool b; b = FormChecker.CheckDate(txtDate, lblDate); b &= FormChecker.CheckEmpty(txtNumber, lblNumber); return(b); }
private void btnShow_Click(object sender, EventArgs e) { bool b = FormChecker.CheckDate(txtFromDate, lblFromDate); b &= FormChecker.CheckDate(txtToDate, lblToDate); if (!b) { MessageBox.Show("خطا در تاریخ های وارده شده"); return; } loadList(RMX_TOOLS.date.DateXFormer.persianToGreGorian(txtFromDate.Text), RMX_TOOLS.date.DateXFormer.persianToGreGorian(txtToDate.Text)); }
private void btnShow_Click(object sender, EventArgs e) { bool b = FormChecker.CheckDate(txtFromDate, lblFromDate); b &= FormChecker.CheckDate(txtToDate, lblToDate); int count = 0; try { count = int.Parse(txtReferLimit.Text); } catch (Exception ex) { MessageBox.Show("عدد وارد شده صحیح نیست"); return; } if (!b) { MessageBox.Show("خطا در تاریخ های وارده شده"); return; } try { while (dataGridView1.Rows.Count > 0) { dataGridView1.Rows.RemoveAt(0); } } catch (Exception ex) { } DateTime dateFrom = RMX_TOOLS.date.DateXFormer.persianToGreGorian(txtFromDate.Text); DateTime dateTo = RMX_TOOLS.date.DateXFormer.persianToGreGorian(txtToDate.Text); ReferCountLetterEntity en = _referLetterBL.getReferCount(count, dateFrom, dateTo); ArrayList list = getLetterWithReffereds(en); int currentRowIndex = 0; for (int i = 0; i < list.Count; i++) { currentRowIndex = dataGridView1.Rows.Add(); dataGridView1.Rows[currentRowIndex].Cells[0].Value = ((ArrayList)list[i])[0]; dataGridView1.Rows[currentRowIndex].Cells[1].Value = ((ArrayList)list[i])[1]; dataGridView1.Rows[currentRowIndex].Cells[2].Value = ((ArrayList)list[i])[2]; dataGridView1.Rows[currentRowIndex].Cells[3].Value = ((ArrayList)list[i])[3]; dataGridView1.Rows[currentRowIndex].Cells[4].Value = ((ArrayList)list[i])[4]; } }
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); }
private void btnReffferLetter_Click(object sender, EventArgs e) { LetterBL letterBL = new LetterBL(); ChequeBL chequeBL = new ChequeBL(); IsRefferDone = false; int assignedUserId = 0; if (LetterId > 0) { LetterEntity letterEntity = letterBL.getByLetterId(LetterId); int assignedUserTreeId = int.Parse(letterEntity.get(LetterEntity.FIELD_USER_TREE_ID).ToString()); assignedUserId = _userTreeBL.getUserIdByTreeId(assignedUserTreeId); bool b = FormChecker.CheckDate(txtRefferDate, lblRefferDate); if (!b) { return; } } if (ChequeId > 0) { ChequeEntity chequeEntity = chequeBL.get(ChequeId); int assignedUserTreeId = int.Parse(chequeEntity.get(ChequeEntity.FIELD_USER_TREE_ID).ToString()); assignedUserId = _userTreeBL.getUserIdByTreeId(assignedUserTreeId); } if (lstUserList.Items.Count <= 0 || lstUserList.SelectedIndex < 0) { MessageBox.Show("لطفا کاربری را انتخاب نمایید !"); return; } ComboBoxItem item = (ComboBoxItem)lstUserList.Items[lstUserList.SelectedIndex]; int userTreeId = int.Parse(item.Value); int assigntoNewUserID = _userTreeBL.getUserIdByTreeId(userTreeId); if (assignedUserId == assigntoNewUserID) { MessageBox.Show("آیتم مورد نظر در حال حاضر در اختیار کاربر انتخاب شده می باشد. "); return; } DialogResult re = MessageBox.Show("آیا از انجام عمل ارجاع مطمئن هستید ؟ ", "", MessageBoxButtons.YesNo); if (re.Equals(DialogResult.No)) { return; } if (_letterId >= 0) { letterBL.updateRefferenceUser(_letterId, userTreeId); letterBL.updateRefferenceDate(RMX_TOOLS.date.DateXFormer.persianToGreGorian(txtRefferDate.Text), LetterId); lblMsg.Text = "ارجاع انجام گردید!"; } else if (_chequeId >= 0) { chequeBL.updateRefferenceUser(_chequeId, userTreeId); lblMsg.Text = "ارجاع انجام گردید!"; } IsRefferDone = true; // this.Close(); }
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); }