void Clear() { customer = new Customers(); this.DataContext = customer; #region code tb_custCode.Text = ""; #endregion #region mobile-Phone-fax-email-country //cb_areaMobile.SelectedValue = MainWindow.Region.countryId; //cb_areaPhone.SelectedValue = MainWindow.Region.countryId; //cb_areaFax.SelectedValue = MainWindow.Region.countryId; cb_country.SelectedIndex = -1; cb_areaMobile.SelectedIndex = -1; cb_areaPhone.SelectedIndex = -1; cb_areaFax.SelectedIndex = -1; cb_areaPhoneLocal.SelectedIndex = -1; cb_areaFaxLocal.SelectedIndex = -1; tb_mobile.Clear(); tb_phone.Clear(); tb_fax.Clear(); tb_email.Clear(); #endregion #region image HelpClass.clearImg(btn_image); #endregion // last HelpClass.clearValidateWindow(requiredControlList, this); p_error_email.Visibility = Visibility.Collapsed; }
private void Dg_package_SelectionChanged(object sender, SelectionChangedEventArgs e) {//selection try { if (dg_package.SelectedIndex != -1) { countryPackageDate = dg_package.SelectedItem as CountryPackageDate; this.DataContext = countryPackageDate; if (countryPackageDate != null) { this.DataContext = countryPackageDate; if (!countryPackageDate.islimitDate) { cb_month.SelectedValue = 0; } else { switch (countryPackageDate.monthCount) { case 1: cb_month.SelectedValue = 1; break; case 3: cb_month.SelectedValue = 3; break; case 6: cb_month.SelectedValue = 6; break; case 12: cb_month.SelectedValue = 12; break; } } this.DataContext = countryPackageDate; #region delete if (countryPackageDate.canDelete) { btn_delete.Content = MainWindow.resourcemanager.GetString("trDelete"); } else { if (countryPackageDate.isActive == 0) { btn_delete.Content = MainWindow.resourcemanager.GetString("trActive"); } else { btn_delete.Content = MainWindow.resourcemanager.GetString("trInActive"); } } #endregion } } HelpClass.clearValidateWindow(requiredControlList, this); } catch (Exception ex) { HelpClass.ExceptionMessage(ex, this); } }
void Clear() { countryPackageDate.Id = 0; cb_country.SelectedIndex = -1; cb_month.SelectedIndex = -1; this.DataContext = new CountryPackageDate(); // last HelpClass.clearValidateWindow(requiredControlList, this); }