private void loadDataRow() { textEditHo.Text = dataRow["HO"]?.ToString(); textEditTenDem.Text = dataRow["TENDEM"].ToString(); textEditTen.Text = dataRow["TEN"]?.ToString(); textEditTaiKhoan.Text = dataRow["MANV"]?.ToString(); textEditMatKhau.Text = dataRow["MATKHAU"]?.ToString(); textEditSDT.Text = dataRow["SDT"]?.ToString(); textEditEmail.Text = dataRow["EMAIL"]?.ToString(); spinEditTienLuong.Text = dataRow["LUONG"]?.ToString(); comboBoxEditChucVu.Text = dataRow["CHUCVU"]?.ToString(); pictureEditAnh.Image = (!Convert.IsDBNull(dataRow["ANH"]) ? ProcessImage.byteArrayToImage((byte[])dataRow["ANH"]) : null); textEditDiaChi.Text = dataRow["DIACHI"]?.ToString(); }
private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { dataRow["HO"] = textEditHo.Text; dataRow["TENDEM"] = textEditTenDem.Text; dataRow["TEN"] = textEditTen.Text; dataRow["MANV"] = textEditTaiKhoan.Text; dataRow["MATKHAU"] = textEditMatKhau.Text; dataRow["SDT"] = textEditSDT.Text; dataRow["EMAIL"] = textEditEmail.Text; dataRow["LUONG"] = spinEditTienLuong.Value; dataRow["CHUCVU"] = comboBoxEditChucVu.Text; dataRow["ANH"] = (pictureEditAnh.Image != null ? ProcessImage.ImageToByteArray(pictureEditAnh.Image, System.Drawing.Imaging.ImageFormat.Png) : null); dataRow["DIACHI"] = textEditDiaChi.Text; if (isEdit) { sendEditData(dataRow, ref gridView); } else { sendNewNhanVien(dataRow); } }
private void setPictureEditAvatarNhanVien(byte[] byteImage) { pictureEditAvatar.Image = (byteImage != null ? ProcessImage.byteArrayToImage(byteImage) : null); }