private void dgv_pointeuse_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (dgv_pointeuse.CurrentRow.Cells["id"].Value != null) { int id = Convert.ToInt32(dgv_pointeuse.CurrentRow.Cells["id"].Value); if (id > 0) { currentPointeuse = Constantes.POINTEUSES.Find(x => x.Id == id); if (currentPointeuse != null ? currentPointeuse.Id > 0 : false) { currentPointeuse = PointeuseBLL.OneById(id); } LoadDestination(); } else { ResetDataPointeuse(); } } } catch (Exception ex) { Messages.Exception("Form_Empreinte (dgv_pointeuse_CellContentClick) ", ex); } }
private void dgv_pointeuse_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (dgv_pointeuse.CurrentRow.Cells["ID"].Value != null) { int id = Convert.ToInt32(dgv_pointeuse.CurrentRow.Cells["ID"].Value); if (id > 0) { currentPointeuse = Constantes.POINTEUSES.Find(x => x.Id == id); if (currentPointeuse != null ? currentPointeuse.Id > 0 : false) { currentPointeuse = PointeuseBLL.OneById(id); } btn_load_by_appareil.Text = "Charger Log (Pointeuse : " + currentPointeuse.Ip + ")"; LoadFileBackup(); dgv_log.Rows.Clear(); } else { ResetDataPointeuse(); } btn_del_doublon.Enabled = false; } } catch (Exception ex) { Messages.Exception("Form_Archive_Pointeuse (dgv_pointeuse_CellContentClick) ", ex); } }
private void dgv_destination_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (dgv_destination.CurrentRow.Cells["id_d"].Value != null) { int id = Convert.ToInt32(dgv_destination.CurrentRow.Cells["id_d"].Value); if (id > 0) { Pointeuse p = Constantes.POINTEUSES.Find(x => x.Id == id); if (p != null ? p.Id > 0 : false) { p = PointeuseBLL.OneById(id); } if (p != null ? p.Id > 0 : false) { int pos = Utils.GetRowData(dgv_destination, id); ObjectThread o = new ObjectThread(dgv_destination); o.RemoveDataGridView(pos); Pointeuse p_ = destinations.Find(x => x.Id == p.Id); if (p_ != null ? p_.Id > 0 : false) { destinations.RemoveAt(destinations.FindIndex(x => x.Id == p.Id)); o.WriteDataGridView(pos, new object[] { p.Id, false, p.Ip, }); } else { destinations.Add(p); o.WriteDataGridView(pos, new object[] { p.Id, true, p.Ip, }); } ResetDataDestination_(); dgv_destination.Rows[pos].Selected = true; } } else { ResetDataDestination(); } } } catch (Exception ex) { Messages.Exception("Form_Empreinte (dgv_destination_CellContentClick) ", ex); } }