Beispiel #1
0
 private void fusionnerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (position > -1)
     {
         Presence presence = presences[position];
         presence.Pointages = pointages;
         if (presence != null ? presence.Id > 0 : false)
         {
             string          adresse = Constantes.SOCIETE.AdresseIp;
             List <Presence> list    = PresenceBLL.List("select p.* from yvs_grh_presence p where p.employe = " + presence.Employe.Id + " and p.date_debut = '" + dtp_date.Value + "' order by heure_debut", true, adresse);
             if (list != null ? list.Count > 1 : false)
             {
                 foreach (Presence p in list)
                 {
                     if (p.Id != presence.Id)
                     {
                         presence.Pointages.AddRange(PointageBLL.List("select * from yvs_grh_pointage where presence = " + p.Id, true, adresse));
                         Bll.RequeteLibre("delete from yvs_grh_presence where id = " + p.Id, adresse);
                         presences.Remove(p);
                         lb_pagination.Text = (position + 1) + "/" + presences.Count;
                         txt_index_of.Text  = (position + 1).ToString();
                     }
                 }
             }
             ReorganiserFiche(presence);
         }
     }
 }
        private void loadPointage(Presence y, string adresse)
        {
            object_pointage.ClearDataGridView(true);

            if (y != null ? y.Id > 0 : false)
            {
                presence = y;

                string          query = "select * from yvs_grh_pointage where presence = " + y.Id;
                List <Pointage> lp    = PointageBLL.List(query, true, adresse);
                if (lp != null ? lp.Count > 0 : false)
                {
                    foreach (Pointage p in lp)
                    {
                        object[] value = new object[] { p.Id, p.HeureEntree.ToShortTimeString(), p.HeureSortie.ToShortTimeString(), p.Duree, p.Valider, p.Supplementaire, false, true };
                        object_pointage.WriteDataGridView(value);
                    }
                }
            }
        }
Beispiel #3
0
        private void dgv_pointage_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataGridViewCell cell = this.dgv_pointage.Rows[e.RowIndex].Cells[0];
            Pointage         po   = PointageBLL.OneById(Convert.ToInt32(cell.Value));

            if ((e.ColumnIndex == this.dgv_pointage.Columns["heure_sortie"].Index) && e.Value != null)
            {
                cell = this.dgv_pointage.Rows[e.RowIndex].Cells[e.ColumnIndex];
                if ((po.HeureSortie != null) ? po.HeureSortie.ToString() != "01/01/0001 00:00:00" : false)
                {
                    cell.ToolTipText = po.HeureSortie.ToString();
                }
            }
            else if ((e.ColumnIndex == this.dgv_pointage.Columns["heure_entree"].Index) && e.Value != null)
            {
                cell = this.dgv_pointage.Rows[e.RowIndex].Cells[e.ColumnIndex];
                if ((po.HeureEntree != null) ? po.HeureEntree.ToString() != "01/01/0001 00:00:00" : false)
                {
                    cell.ToolTipText = po.HeureEntree.ToString();
                }
            }
        }
Beispiel #4
0
        private void LoadPointage(Presence p)
        {
            try
            {
                string adresse = Constantes.SOCIETE.AdresseIp;
                object_statut.SetValueBar(0);
                Constantes.PBAR_WAIT = pbar_statut;

                ObjectThread o = new ObjectThread(dgv_pointage);
                o.ClearDataGridView(true);

                string query      = "select * from yvs_grh_pointage where presence = " + p.Id + " order by heure_entree, heure_sortie";
                string queryCount = "select count(id) from yvs_grh_pointage where presence = " + p.Id + "";
                pointages = PointageBLL.List(query, true, queryCount, adresse);
                for (int i = 0; i < pointages.Count; i++)
                {
                    o.WriteDataGridView(new object[] { pointages[i].Id, i + 1, pointages[i].HeureEntree.ToShortTimeString(), pointages[i].HeureSortie.ToShortTimeString(), Utils.GetTime(pointages[i].Duree), pointages[i].Valider, pointages[i].Supplementaire });
                }
            }
            catch (Exception ex)
            {
                Messages.Exception("Form_Presence (LoadPointage)", ex);
            }
        }