private (bool, DataTable) ComboErrorCheck(SCombo sCombo) { DataTable rDt = new DataTable(); if (sCombo.E102) { if (sCombo.SelectedIndex.ToString() == "-1" || sCombo.SelectedIndex.ToString() == "0") { ShowErrorMessage("E102"); sCombo.Focus(); return(true, rDt); } } if (sCombo.E106) { if (!string.IsNullOrEmpty(sCombo.ctrlE106_1.Text.ToString()) && !string.IsNullOrEmpty(sCombo.ctrlE106_2.Text.ToString())) { bool bl = Matches(sCombo.ctrlE106_2.SelectedValue.ToString(), sCombo.ctrlE106_1.SelectedValue.ToString()); if (!bl) { ShowErrorMessage("E106"); sCombo.Focus(); return(true, rDt); } } } return(false, rDt); }
public void MoveNextCell() { //ktp added -- to prevent infinite loop when all columns are readonly Control[] ctlmode = this.TopLevelControl.Controls.Find("cboMode", true); if (ctlmode.Length > 0) { SCombo cbo = this.TopLevelControl.Controls.Find("cboMode", true)[0] as SCombo; if (cbo.SelectedValue.Equals("3") || cbo.SelectedValue.Equals("4"))//all col readonly { return; } } if (this.CurrentCell != null) { int icolumn = this.CurrentCell.ColumnIndex; int irow = this.CurrentCell.RowIndex; bool found = false; bool canrowIncrease = true; while (!found) { if (irow == this.Rows.Count - 1) { canrowIncrease = false; } if (icolumn == this.Columns.Count - 1) { if (canrowIncrease) { irow++; } else { irow = 0; } icolumn = 0; } else { icolumn++; } if (this[icolumn, irow].Visible == true && this[icolumn, irow].ReadOnly == false) { found = true; } } this.CurrentCell = this[icolumn, irow]; } }
public (bool, DataTable) Check(Control ctrl) { DataTable dt = new DataTable(); if (ctrl is STextBox) { STextBox sTextBox = ctrl as STextBox; (bool, DataTable)r_value = TextBoxErrorCheck(sTextBox); return(r_value); } if (ctrl is ComboBox) { SCombo sCombo = ctrl as SCombo; (bool, DataTable)r_value = ComboErrorCheck(sCombo); return(r_value); } if (ctrl is SCheckBox) { SCheckBox sCheckBox = ctrl as SCheckBox; (bool, DataTable)r_value = CheckBoxErrorCheck(sCheckBox); return(r_value); } return(false, dt); }
public void E106Check(bool value, SCombo ctrl1, SCombo ctrl2) { E106 = value; ctrlE106_1 = ctrl1; ctrlE106_2 = ctrl2; }