private void timer1_Tick(object sender, EventArgs e) { fDIEMDANH_CAMERA.mothodHasing(SetValue); if (!ds.Contains(resultHashing) && resultHashing != null) { ds.Add(resultHashing); if (ds != null) { dvs.Enqueue(BUS.doanVienBUS.Instance.getByHASHDOANVIEN(ds[i++])); } resultHashing = null; } for (int j = tam.Count; j < 5; j++) { if (dvs.Count != 0) { DOANVIEN dv = dvs.Dequeue(); tam.Add(dv); showClient(dv); } else { break; } } }
public DOANVIEN getByHASHDOANVIEN(string hashing) { DOANVIEN dv = doanVienDAO.Instance.getByHASHING(hashing); if (dv != null) return dv; return null; }
public DOANVIEN getByDOANVIEN(string cmnd) { DOANVIEN dv = doanVienDAO.Instance.getByDOANVIEN(cmnd); if (dv != null) return dv; else return null; }
private void gridView1_RowClick(object sender, RowClickEventArgs e) { bindDingInfo(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[1]).ToString()); data = BUS.doanVienBUS.Instance.getByDOANVIEN(tbCMND.Text); btnDelete.Enabled = true; btnUpdate.Enabled = true; enabledInfo(); }
public List <DOANVIEN> doanVienThamDu(Guid id) { List <DOANVIEN> dsdv = new List <DOANVIEN>(); foreach (var item in chiTietDaiHoiDAO.Instance.danhDachThamDu(id)) { DOANVIEN dv = doanVienDAO.Instance.getByGUIDDOANVIEN(item); if (dv != null) { dsdv.Add(dv); } } return(dsdv); }
private void btnUpdate_Click(object sender, EventArgs e) { if (BUS.doanVienBUS.Instance.checkExistedDOANVIEN(tbCMND.Text)) { DOANVIEN dv = new DOANVIEN(); dv.MASODV = data.MASODV; dv.CMND = tbCMND.Text; dv.HOLOT = tbFirstName.Text; dv.TEN = tbLastName.Text; dv.NAM = cbIsMale.Checked; dv.NGUYENQUAN = cbbDomicile.Text; dv.DANTOC = cbbNation.Text; dv.TONGIAO = cbbReligion.Text; dv.CMNV = tbSpecialize.Text; dv.LLCT = tbPolitic.Text; if (String.Empty != tbUnionistIn.Text) { dv.NGAYVAODOAN = dtpUnionistIn.Value; } else { dv.NGAYVAODOAN = null; } if (String.Empty != tbLeaguerIn.Text) { dv.NGAYVAODANG = dtpLeaguerIn.Value; } else { dv.NGAYVAODANG = null; } dv.GHICHU = null; dv.HASHING = Hash.ComputeSha256Hash(tbCMND.Text + tbFirstName.Text + tbLastName.Text + cbIsMale.Checked); dv.NGAYCAPNHAT = DateTime.Now; saveImage(ptbAvatar, tbCMND.Text); QRGenerator.Instance.createQRCode(dv.HASHING); BUS.doanVienBUS.Instance.updateUser(dv); btnUpdate.Enabled = false; btnDelete.Enabled = false; refesh(); } else { XtraMessageBox.Show("Chứng Minh Nhân Dân Đã Tồn Tại"); } }
private void timer2_Tick(object sender, EventArgs e) { if (tam.Count != 0) { DOANVIEN dv = tam.First(); showMain(dv); tam.Remove(dv); foreach (Control item in flpAllUser.Controls) { flpAllUser.Controls.Remove(item); item.Dispose(); break; } } }
public void showClient(DOANVIEN _clientName) { Color col = ColorTranslator.FromHtml("#179BD7"); Label label = new Label() { ForeColor = col, Height = 20, Width = 100, Text = _clientName.HOLOT + " " + _clientName.TEN, TextAlign = ContentAlignment.TopCenter, Left = 25, Margin = this.Margin }; var margin = label.Margin; margin.Left = 25; label.Margin = margin; Button btn = new Button() { Width = 100, Height = 100, BackgroundImageLayout = ImageLayout.Stretch, BackgroundImage = Image.FromFile(Application.StartupPath + "\\Images\\" + _clientName.CMND + ".jpg"), }; btn.Margin = margin; FlowLayoutPanel flowLayout = new FlowLayoutPanel() { Height = 165, Width = 150, }; flowLayout.Controls.Add(btn); flowLayout.Controls.Add(label); flpAllUser.BeginInvoke((Action)(() => { flpAllUser.Controls.Add(flowLayout); })); }
private void gridView1_DoubleClick(object sender, EventArgs e) { float ptNam, ptNu; int coMat = 0, vangMat = 0, tong, nam = 0, nu = 0; fTHONGKE tk = new fTHONGKE(); List <Guid> guids = chiTietDaiHoiDAO.Instance.danhDachThamDu(id); tong = guids.Count; foreach (var item in guids) { bool check = chiTietDaiHoiDAO.Instance.getStatus(item, id); if (check) { coMat++; } else { vangMat++; } DOANVIEN dv = doanVienDAO.Instance.getByGUIDDOANVIEN(item); if (dv != null) { if ((bool)dv.NAM) { nam++; } else { nu++; } } } ptNam = ((float)nam / tong) * 100; ptNu = ((float)nu / tong) * 100; tk.load(tong.ToString(), coMat.ToString(), vangMat.ToString(), nam.ToString(), ptNam.ToString("N2"), nu.ToString(), ptNu.ToString("N2")); tk.ShowDialog(); }
DataTable dataTable = new DataTable(); // openFileExcel(); private bool insertUSERtoEXCEL(Guid id) { foreach (DataRow item in dataTable.Rows) { DOANVIEN dv = new DOANVIEN(); if (BUS.doanVienBUS.Instance.getByDOANVIEN(item[0].ToString()) == null) { dv.MASODV = GuidComb.GenerateComb(); dv.CMND = item[0].ToString(); dv.HOLOT = item[1].ToString(); dv.TEN = item[2].ToString(); dv.NAM = item[3].ToString() == "1" ? true : false; dv.NGUYENQUAN = item[4].ToString(); dv.DANTOC = item[5].ToString(); dv.TONGIAO = item[6].ToString(); dv.CMNV = item[7].ToString(); dv.LLCT = item[8].ToString(); if (String.Empty == item[9].ToString()) { dv.NGAYVAODOAN = null; } else { DateTime temp = (DateTime)item[9]; dv.NGAYVAODOAN = new DateTime(temp.Year, temp.Month, temp.Day); } if (String.Empty == item[10].ToString()) { dv.NGAYVAODANG = null; } else { DateTime temp = (DateTime)item[10]; dv.NGAYVAODANG = new DateTime(temp.Year, temp.Month, temp.Day); } dv.GHICHU = null; dv.HASHING = Hash.ComputeSha256Hash(dv.CMND + dv.HOLOT + dv.TEN + dv.NAM); dv.NGAYTAO = DateTime.Now; dv.NGAYCAPNHAT = DateTime.Now; //saveImage(ptbAvatar, tbCMND.Text); QRGenerator.Instance.createQRCode(dv.HASHING); BUS.doanVienBUS.Instance.addUser(dv); refesh(); dv = doanVienDAO.Instance.getByDOANVIEN(item[0].ToString()); data.Add(dv); } else { dv = doanVienDAO.Instance.getByDOANVIEN(item[0].ToString()); data.Add(dv); } } BUS.chiTietDaiHoiBUS.Instance.dsThamDu(id, data); data.Clear(); return(true); }
private void showMain(DOANVIEN dv) { ptbMain.BackgroundImage = Image.FromFile(Application.StartupPath + "\\Images\\" + dv.CMND + ".jpg"); }
public bool updateUser(DOANVIEN dv) { if (doanVienDAO.Instance.updateInfoDOANVIEN(dv)) return true; return false; }
public bool addUser(DOANVIEN dv) { if (doanVienDAO.Instance.addInfo(dv)) return true; return false; }
public bool deleteInfoDOANVIEN(DOANVIEN dv) { if (doanVienDAO.Instance.deleteInfoDOANVIEN(dv)) return true; return false; }
private void btnSave_Click(object sender, EventArgs e) { DialogResult dialogResult = XtraMessageBox.Show("Bạn muốn lưu thông tin!", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { if (BUS.doanVienBUS.Instance.checkExistedDOANVIEN(tbCMND.Text)) { DOANVIEN dv = new DOANVIEN(); dv.MASODV = GuidComb.GenerateComb(); dv.CMND = tbCMND.Text; dv.HOLOT = tbFirstName.Text; dv.TEN = tbLastName.Text; dv.NAM = cbIsMale.Checked; dv.NGUYENQUAN = cbbDomicile.Text; dv.DANTOC = cbbNation.Text; dv.TONGIAO = cbbReligion.Text; dv.CMNV = tbSpecialize.Text; dv.LLCT = tbLeaguerIn.Text; if (String.Empty != tbUnionistIn.Text) { dv.NGAYVAODOAN = dtpUnionistIn.Value; } else { dv.NGAYVAODOAN = null; } if (String.Empty != tbLeaguerIn.Text) { dv.NGAYVAODANG = dtpLeaguerIn.Value; } else { dv.NGAYVAODANG = null; } dv.GHICHU = null; dv.HASHING = Hash.ComputeSha256Hash(tbCMND.Text + tbFirstName.Text + tbLastName.Text + cbIsMale.Checked); dv.NGAYTAO = DateTime.Now; dv.NGAYCAPNHAT = DateTime.Now; saveImage(ptbAvatar, tbCMND.Text); QRGenerator.Instance.createQRCode(dv.HASHING); BUS.doanVienBUS.Instance.addUser(dv); refesh(); gcInfo.Enabled = true; btnAdd.Enabled = true; btnUpdate.Enabled = true; btnDelete.Enabled = true; btnSave.Hide(); } else { XtraMessageBox.Show("Chứng Minh Nhân Dân Đã Tồn Tại"); } } else { clearInfo(); gcInfo.Enabled = true; btnAdd.Enabled = true; btnUpdate.Enabled = true; btnDelete.Enabled = true; btnSave.Hide(); } }