/// <summary> /// 初始化雅座 /// </summary> internal void Initial(Member member) { this.member = member; ResetAll(); ShowInfoByLang(); MemberNo = member.MemberNo; if (!string.IsNullOrEmpty(member.Phone)) { PhoneNo = member.Phone; } SexList.Add(new Dict() { Name = Resources.Instance.GetString("Male"), Value = "1" }); SexList.Add(new Dict() { Name = Resources.Instance.GetString("Female"), Value = "0" }); SelectedSex = SexList.FirstOrDefault(x => int.Parse(x.Value.ToString()) == member.Sex); if (null == SelectedSex) { SelectedSex = SexList.FirstOrDefault(); } }
/// <summary> /// 初始化 /// </summary> internal void ResetAll() { MemberNo = ""; PhoneNo = ""; PersonName0 = ""; PersonName1 = ""; PersonName2 = ""; SexList.Clear(); SelectedSex = null; MultiLanguage = false; }
private RegisterUpdateUC() { InitializeComponent(); sc = new Service1Client(); dc = new UserImageDC() { TheUser = new User(), TheImage = "", }; slist = sc.GetAllSexes(); SexBox.ItemsSource = slist; plist = sc.GetAllPreferences(); PreferenceBox.ItemsSource = plist; alist = sc.GetAllAreaCodes(); AreaCodeBox.ItemsSource = alist; this.DataContext = dc; DateOfBirthPicker.DisplayDateStart = DateTime.Now.AddYears(-18); DateOfBirthPicker.DisplayDateEnd = DateTime.Now.AddYears(-120); }
public RegisterPU(Admin father) : this() { admin = father; sr = new Service1Client(); xx = new UserImageDC() { TheUser = new User(), TheImage = "", }; slist = sr.GetAllSexes(); SexBox.ItemsSource = slist; plist = sr.GetAllPreferences(); PreferenceBox.ItemsSource = plist; alist = sr.GetAllAreaCodes(); AreaCodeBox.ItemsSource = alist; this.DataContext = xx; SexBox.SelectedItem = xx.TheUser.Sex; PreferenceBox.SelectedItem = xx.TheUser.Preference; dp.DisplayDateEnd = DateTime.Now; dp.DisplayDateStart = DateTime.Now.AddYears(-120); this.DataContext = xx; }