public addLiecse(object o) { InitializeComponent(); BindBox.bindCarType(this.LicenseType); cz = (Citizen)o; cm = new Carmanager(); }
public addCitizen(bool ismodify, object o) { this.InitializeComponent(); BindBox.bindCitizenCrimestatus(this.CitizenCrimestatus); BindBox.bindCitizenHometown(this.CitizenHome); BindBox.bindCitizenGender(this.CitizenGender); photopath = ""; modifyc = (Citizen)o; this.ismodify = ismodify; if (ismodify) { this.CitizenID.IsEnabled = false; this.CitizenName.Text = modifyc.Name; this.CitizenAddress.Text = modifyc.Address; this.CitizenBirthday.Text = modifyc.Birthday; if (modifyc.Gender == "M") { this.CitizenGender.Text = "男"; } if (modifyc.Gender == "F") { this.CitizenGender.Text = "女"; } string hometown = modifyc.Hometown; this.CitizenHome.Text = hometown.TrimEnd(); this.CitizenID.Text = modifyc.PKID; this.CitizenPhone.Text = modifyc.Telephone; this.CitizenPhoto.Source = modifyc.Photo; this.CitizenCrimestatus.Text = modifyc.Crimestatus; tax = modifyc.Tax; } else { tax = 10; } // 在此点之下插入创建对象所需的代码。 }
private void changePerson_Click(object sender, RoutedEventArgs e) { selectCitizen sc = new selectCitizen(); if (sc.ShowDialog() ?? false) { Citizen c = (Citizen)sc.Addo; themanager = c; this.CarOfPersonID.Text = c.PKID; } }