private void EditDriverForm_Load(object sender, EventArgs e) { if (labType.Text == "编辑") { txtUserChineseName.Text = driverlist.User_ChineseName; txtUserEnglisthName.Text = driverlist.User_EnglishName; txtChineseDepartment.Text = driverlist.Department_ChineseName; txEnglishDepartmentName.Text = driverlist.Department_EnglishName; driverlist.Job = txtJob.Text; txtSex.Text = driverlist.Sex; txtBirthdy.Text = driverlist.Birthdy; txtIdType.Text = driverlist.Identification_Type; txtIdNumber.Text = driverlist.Identification_Number; txtDepartment.Text = driverlist.Employer; txtTelephone.Text = driverlist.Telephone; txtCurrentResident.Text = driverlist.CurrentResidence; txtHuji.Text = driverlist.CensusRegister; using (MemoryStream memStream = new MemoryStream(PictureHelper.ExportImage(Convert.ToInt32(driverlist.Id), "TB_DriverList", "Photo"))) { if (memStream != null || memStream.Length > 0) { this.Pic.Image = Image.FromStream(memStream); txtPicture.Visible = false; bntAddPicture.Visible = false; } } } }
private void CarEditForm_Load(object sender, EventArgs e) { if (labEidt.Text == "编辑") { txtPlateNumber.Text = car.PlateNumber; txtColor.Text = car.Color; txtCarResource.Text = car.CarResource; txtBrand.Text = car.Brand; txtMotorcyleType.Text = car.MotorcyleType; using (MemoryStream memStream = new MemoryStream(PictureHelper.ExportImage(Convert.ToInt32(car.Id), "TB_Car", "CarPicture"))) { if (memStream != null || memStream.Length > 0) { this.picCar.Image = Image.FromStream(memStream); txtUploadFile.Visible = false; btnUploadFile.Visible = false; } } } if (labEidt.Text == "新增") { } }