示例#1
0
        private static Empreinte Return(NpgsqlDataReader lect)
        {
            Empreinte bean = new Empreinte();

            bean.Id        = Convert.ToInt32(lect["id"].ToString());
            bean.Digital   = Convert.ToInt32(lect["empreinte_digital"].ToString());
            bean.Facial    = Convert.ToInt32(lect["empreinte_faciale"].ToString());
            bean.Numerique = Convert.ToInt32(lect["empreinte_numerique"].ToString());
            bean.Flag      = Convert.ToInt32(lect["flag"].ToString());
            bean.Longueur  = Convert.ToInt32(lect["longueur"].ToString());
            bean.Employe   = EmployeDAO.getOneById(Convert.ToInt32(lect["employe"].ToString()), false, null);
            bean.Template  = Convert.FromBase64String(lect["template"].ToString());
            bean.STemplate = lect["template"].ToString();
            return(bean);
        }
示例#2
0
        private static Presence Return(NpgsqlDataReader lect, bool full)
        {
            Presence bean = new Presence();

            bean.Id                  = Convert.ToInt32(lect["id"].ToString());
            bean.DateDebut           = (DateTime)((lect["date_debut"] != null) ? (!lect["date_debut"].ToString().Trim().Equals("") ? lect["date_debut"] : DateTime.Now) : DateTime.Now);
            bean.DateFin             = (DateTime)((lect["date_fin"] != null) ? (!lect["date_fin"].ToString().Trim().Equals("") ? lect["date_fin"] : DateTime.Now) : DateTime.Now);
            bean.DateFinPrevu        = (DateTime)((lect["date_fin_prevu"] != null) ? (!lect["date_fin_prevu"].ToString().Trim().Equals("") ? lect["date_fin_prevu"] : DateTime.Now) : DateTime.Now);
            bean.HeureDebut          = (DateTime)((lect["heure_debut"] != null) ? (!lect["heure_debut"].ToString().Trim().Equals("") ? lect["heure_debut"] : DateTime.Now) : DateTime.Now);
            bean.HeureFin            = (DateTime)((lect["heure_fin"] != null) ? (!lect["heure_fin"].ToString().Trim().Equals("") ? lect["heure_fin"] : DateTime.Now) : DateTime.Now);
            bean.HeureFinPrevu       = (DateTime)((lect["heure_fin_prevu"] != null) ? (!lect["heure_fin_prevu"].ToString().Trim().Equals("") ? lect["heure_fin_prevu"] : DateTime.Now) : DateTime.Now);
            bean.TotalPresence       = (Double)((lect["total_presence"] != null) ? (!lect["total_presence"].ToString().Trim().Equals("") ? lect["total_presence"] : 0.0) : 0.0);
            bean.TotalSupplementaire = (Double)((lect["total_heure_sup"] != null) ? (!lect["total_heure_sup"].ToString().Trim().Equals("") ? lect["total_heure_sup"] : 0.0) : 0.0);
            bean.Valider             = Convert.ToBoolean((lect["valider"].ToString() != "") ? lect["valider"].ToString() : "false");
            bean.Employe             = new Employe(Convert.ToInt32(lect["employe"].ToString()));
            if (full)
            {
                bean.Employe    = EmployeDAO.getOneById(Convert.ToInt32(lect["employe"].ToString()), false, null);
                bean.Pointeuses = Dao.LoadListObject("select DISTINCT(pointeuse_in) from yvs_grh_pointage where pointeuse_in is not null and presence = " + bean.Id, null);
            }
            return(bean);
        }