public void LoadLogs(List <IOEMDevice> l, bool file) { bFile = file; ObjectThread o_ = new ObjectThread(btn_del_doublon); o_.EnableButton(file); o_ = new ObjectThread(dgv_log); o_.ClearDataGridView(true); if (l != null ? l.Count > 0 : false) { int i = 0; ObjectThread o1 = new ObjectThread(Constantes.PBAR_WAIT); o1.UpdateMaxBar(Constantes.PBAR_WAIT.Maximum + l.Count); foreach (IOEMDevice o in l) { ++i; Employe e = EmployeBLL.OneById(o.idwSEnrollNumber); if (e != null ? e.Id < 1 : true) { e = new Employe(o.idwSEnrollNumber, o.idwSEnrollNumber.ToString(), ""); } DateTime date = new DateTime(o.idwYear, o.idwMonth, o.idwDay, o.idwHour, o.idwMinute, o.idwSecond); o_.WriteDataGridView(new object[] { i, e.Id, e.Nom + " " + e.Prenom, date.ToShortDateString(), date.ToLongTimeString() }); Constantes.LoadPatience(false); } Constantes.LoadPatience(true); } else { Utils.WriteLog("La liste des logs venants " + (file ? "du fichier (" + currentFile : "de la pointeuse (" + currentPointeuse.Ip) + ") est vide"); } }
private void txt_id_search_Leave(object sender, EventArgs e) { Int32 id = Convert.ToInt32(txt_id_search.Text.Trim()); if (employe != null ? (employe.Id < 0 || !employe.Id.Equals(id)) : true) { employe = EmployeBLL.OneById(id, Constantes.SOCIETE.Id); com_employe.Text = employe.NomPrenom; LoadPresence(dtp_date.Value, employe); } }
private void LoadEmploye() { object_employe.ClearDataGridView(true); employes.Clear(); appareil.EnableDevice(pointeuse.IMachine, false); appareil.ReadAllUserID(pointeuse.IMachine);//read all the user information to the memory switch (pointeuse.Type) { case Constantes.TYPE_IFACE: { string iEnrollNumber = ""; string iName = ""; int iPrivilege = 0; string iPassword = ""; bool iEnabled = false; while (appareil.SSR_GetAllUserInfo(pointeuse.IMachine, out iEnrollNumber, out iName, out iPassword, out iPrivilege, out iEnabled)) { Employe e = new Employe(Convert.ToInt32(iEnrollNumber), iEnrollNumber, ""); e.Nom = iName; e.Password = iPassword; e.Privilege = iPrivilege; e.BEnabled = iEnabled; object_employe.WriteDataGridView(new object[] { e.Id, e.NomPrenom, e.IsPrivilege }); employes.Add(e); } break; } default: { int iEnrollNumber = 0; int iPrivilege = 0; int iEMachineNumber = 0; int iBackupNumber = 0; int iEnabled = 0; while (appareil.GetAllUserID(pointeuse.IMachine, ref iEnrollNumber, ref iEMachineNumber, ref iBackupNumber, ref iPrivilege, ref iEnabled)) { Employe e = EmployeBLL.OneById(iEnrollNumber); if (e != null ? e.Id < 1 : true) { e = new Employe(iEnrollNumber, iEnrollNumber.ToString(), ""); } object_employe.WriteDataGridView(new object[] { e.Id, e.NomPrenom, e.IsPrivilege }); } break; } } appareil.EnableDevice(pointeuse.IMachine, true); ResetEmploye(); }
private void Download() { Utils.WriteLog("-- Début du téléchargement des empreintes"); ObjectThread o = new ObjectThread(Constantes.PBAR_WAIT); o.UpdateMaxBar(empreintes.Count); foreach (Empreinte e in empreintes) { Employe y = EmployeBLL.OneById((int)e.Employe.Id); if (y != null ? y.Id > 0 : false) { if (IS_DIGITAL) { Empreinte e_ = EmpreinteBLL.OneByEmployeFinger(e.Employe.Id, e.Digital); if (e_ != null ? e_.Id < 1 : true) { if (EmpreinteBLL.Insert(e)) { Finger f = (Finger)Finger.Get(e.Digital); Utils.WriteLog("---- Ajout de l'empreinte Doigt(" + f.Doigt + ") Main(" + f.Main + ") de l'employé " + e.Employe.NomPrenom + " effectue!"); } else { Utils.WriteLog("---- Ajout de l'empreinte de l'employé " + e.Employe.NomPrenom + " echoué!"); } } } else { Empreinte e_ = EmpreinteBLL.OneByEmployeFacial(e.Employe.Id, e.Facial); if (e_ != null ? e_.Id < 1 : true) { if (EmpreinteBLL.Insert(e)) { Utils.WriteLog("---- Ajout de l'empreinte faciale de l'employé " + e.Employe.NomPrenom + " effectue!"); } else { Utils.WriteLog("---- Ajout de l'empreinte de l'employé " + e.Employe.NomPrenom + " echoué!"); } } } } else { Utils.WriteLog("---- Ajout de l'empreinte de l'employé " + e.Employe.NomPrenom + " echoué! Car ce tiers n'est pas un employé"); } Constantes.LoadPatience(false); } Utils.WriteLog("-- Fin du téléchargement des empreintes"); Constantes.LoadPatience(true); }
private void LaodPhoto() { Employe e = EmployeBLL.OneById((int)employe.Id); string path = Constantes.SETTING.CheminPhoto + e.Photo; if (File.Exists(path)) { this.box_identity.Image = new Bitmap(path); txt_agence.Text = e.Agence.Name; } else { this.box_identity.Image = global::ZK_Lymytz.Properties.Resources.contact; } lb_nom_prenom.Text = e.NomPrenom; }
private void Dial_Insert_Pointage_Load(object sender, EventArgs e) { if (parent != null) { string adresse = Constantes.SOCIETE.AdresseIp; IOEMDevice current = parent.currentPointage; employe = EmployeBLL.OneById(current.idwSEnrollNumber); txt_id.Text = employe.Id.ToString(); txt_matricule.Text = employe.Matricule; txt_noms.Text = employe.NomPrenom; txt_poste.Text = employe.Poste.Poste.Intitule; try { current_time = new DateTime(current.idwYear, current.idwMonth, current.idwDay, current.idwHour, current.idwMinute, current.idwSecond); dtp_decalage.Value = current_time; time_decalage = current_time; Presence presence = Fonctions.GetPresence(employe, current_time, true, adresse); if (presence != null ? presence.Id > 0 : false) { dtp_date_debut.Value = presence.DateDebut; dtp_date_fin.Value = presence.DateFinPrevu; dtp_heure_debut.Value = presence.HeureDebut; dtp_heure_fin.Value = presence.HeureFinPrevu; box_fich_exit.Image = global::ZK_Lymytz.Properties.Resources.vu; } else { Planning planning = Fonctions.GetPlanning(employe, new DateTime(current_time.Year, current_time.Month, current_time.Day, 0, 0, 0), adresse); dtp_date_debut.Value = planning.DateDebut; dtp_date_fin.Value = planning.DateFin; dtp_heure_debut.Value = planning.HeureDebut; dtp_heure_fin.Value = planning.HeureFin; } } catch (Exception ex) { } this.Text += " [" + current_time.ToShortTimeString() + "]"; } else { this.Dispose(); } }
private void RecupererInformation(Appareil z, Empreinte y) { if (y != null ? y.Id > 0 : false) { Employe emp = EmployeBLL.OneById((int)y.Employe.Id); if (emp != null ? emp.Id > 0 : false) { bool correct = false; switch (currentPointeuse.Type) { case Constantes.TYPE_IFACE: correct = z.SSR_SetUserInfo(currentPointeuse.IMachine, (int)emp.Id, emp.NomPrenom, null, 0, true); //upload user information to the memory break; default: correct = z.SetUserInfo(currentPointeuse.IMachine, (int)emp.Id, emp.NomPrenom, null, 0, true); //upload user information to the memory break; } if (correct) { y.Employe = emp; int pos = Utils.GetRowData(dgv_empreinte, y.Id); ObjectThread o = new ObjectThread(dgv_empreinte); o.RemoveDataGridView(pos); Finger f = (Finger)Finger.Get(y.Digital); Empreinte p = empreintes.Find(x => x.Id == y.Id); bool select = (p != null ? p.Id > 0 : false); o.WriteDataGridView(pos, new object[] { y.Id, select, pos + 1, y.Employe.Id, y.Employe.NomPrenom, f.Main, f.Doigt }); Utils.WriteLog("Recuperation Effectuée pour l'employé " + y.Employe.Id); } else { Utils.WriteLog("Recuperation Impossible pour l'employé " + y.Employe.Id); } } } }