private void countryCodeComboBox_SelectedValueChanged(object sender, EventArgs e) { if (countryCodeComboBox.SelectedValue != null) { atLogic.WhereClause wc = new atLogic.WhereClause(); DataTable dtC = FM.Codes("Province"); wc.Add("CountryCode", "=", countryCodeComboBox.SelectedValue.ToString()); DataView dvC = new DataView(dtC, wc.Filter(), "", DataViewRowState.CurrentRows); provinceCodeComboBox.SetDataBinding(dvC, ""); } //provinceCodeComboBox.SetDataBinding(new DataView(FM.Codes("Province"), "CountryCode='" + countryCodeComboBox.SelectedValue + "'", "ProvinceCode", DataViewRowState.CurrentRows), ""); if (countryCodeComboBox.Text == "Canada") { this.postalCodeEditBox.CharacterCasing = CharacterCasing.Upper; this.postalCodeEditBox.Mask = "L0L 0L0"; } else if (countryCodeComboBox.Text == "United States of America") { this.postalCodeEditBox.CharacterCasing = CharacterCasing.Upper; this.postalCodeEditBox.Mask = "00000"; } else { this.postalCodeEditBox.CharacterCasing = CharacterCasing.Normal; this.postalCodeEditBox.Mask = ""; this.ReqColor = Color.White; } }
private void provinceCodeComboBox_SelectedValueChanged(object sender, EventArgs e) { uiCity.DisplayMember = "City"; uiCity.ValueMember = "City"; object val = uiCity.Text; DataTable dt = FM.Codes("vCity"); atLogic.WhereClause whereCl = new atLogic.WhereClause(); if (provinceCodeComboBox.SelectedValue != null && provinceCodeComboBox.SelectedValue.ToString() != "") { whereCl.Add("ProvinceCode", "=", provinceCodeComboBox.SelectedValue.ToString()); // DataTable dt = FM.AtMng.GetGeneralRec("City", whereCl); uiCity.DataSource = new DataView(dt, whereCl.Filter(), "City", DataViewRowState.CurrentRows); } else { uiCity.DataSource = null; } uiCity.Text = val.ToString(); }