private void Window_Loaded(object sender, RoutedEventArgs e) { if (mCarInfo == null) { mCarInfo = new CarInfo() { id = Guid.NewGuid().ToString() }; mVchicleLicense = new VchicleLicense() { id = Guid.NewGuid().ToString() }; mDrivingLicense = new DrivingLicense() { id = Guid.NewGuid().ToString() }; mDriver = new User() { id = Guid.NewGuid().ToString() }; } else { isUpdate = true; getVchileLicense(); getDriver(); getDrivingLicense(); bindingVchileLicenseinfo(); bindingDrivingLicenseinfo(); } }
private void getDrivingLicense() { String conditon = DrivingLicenseEnum.affiliated_user_id.ToString() + "=" + Constract.valueSplit + mDriver.id + Constract.valueSplit; String sql = DatabaseOPtionHelper.GetInstance().getSelectSql(DataTabeName.driving_license.ToString(), null, conditon); List <DrivingLicense> list = DatabaseOPtionHelper.GetInstance().select <DrivingLicense>(sql); if (list != null && list.Count > 0) { mDrivingLicense = list[0]; } else { MessageBox.Show("获取驾驶证信息出错!" + sql); } }