Пример #1
0
        public static List <Article> SelectAll()
        {
            DataTable dataTable;

            using (SqlConnection con = DbConnection.GetConnection())
            {
                con.Open();
                string     StrSQL  = "SELECT * FROM Article";
                SqlCommand command = new SqlCommand(StrSQL, con);
                dataTable = DataBaseAccessUtilities.SelectRequest(command);
            }
            return(GetListFromDataTable(dataTable));
        }
Пример #2
0
        public static void bindDataToCmbValeur(SqlCeConnection MyConnection, ComboBox Cmb, string ParamTableName, string ParamValueMember, string ParamDisplayMember)
        {
            DataTable dtSource;

            dtSource = DataBaseAccessUtilities.SelectRequest("SELECT * FROM " + ParamTableName, MyConnection);
            if (dtSource != null)
            {
                Cmb.DataSource    = dtSource;
                Cmb.ValueMember   = ParamValueMember;
                Cmb.DisplayMember = ParamDisplayMember;
                Cmb.SelectedIndex = -1;
            }
        }
Пример #3
0
        public static ListInscription SelectAll()
        {
            string       StrSQL  = "SELECT * FROM Inscription ";
            SqlCeCommand Command = new SqlCeCommand(StrSQL, Program.cnn);
            DataTable    Table   = DataBaseAccessUtilities.SelectRequest(Command);

            if (Table != null && Table.Rows.Count != 0)
            {
                return(new ListInscription(Table));
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        public static ListFicheInformations SelectAll()
        {
            string       request = "SELECT * FROM FicheInformation order by NomPrenom ASC";
            SqlCeCommand cmd     = new SqlCeCommand(request, Program.cnn);
            DataTable    dt      = DataBaseAccessUtilities.SelectRequest(cmd);

            if (dt != null && dt.Rows.Count != 0)
            {
                return(new ListFicheInformations(dt));
            }
            else
            {
                return(null);
            }
        }
Пример #5
0
        public static ListDiplome selectAll()
        {
            string       request = "SELECT * FROM Diplome";
            SqlCeCommand cmd     = new SqlCeCommand(request, Program.cnn);
            DataTable    dt      = DataBaseAccessUtilities.SelectRequest(cmd);

            if ((dt != null) && (dt.Rows.Count != 0))
            {
                return(new ListDiplome(dt));
            }
            else
            {
                return(null);
            }
        }
Пример #6
0
        public static ListInscription SelectByCriterium(string FieldName, SqlDbType FieldType, string FieldValue)
        {
            string       StrSQL  = "SELECT * FROM Inscription WEHRE " + FieldName + "= @" + FieldName;
            SqlCeCommand Command = new SqlCeCommand(StrSQL, Program.cnn);

            Command.Parameters.Add("@" + FieldName, FieldType).Value = FieldValue;
            DataTable Table = DataBaseAccessUtilities.SelectRequest(Command);

            if (Table != null && Table.Rows.Count != 0)
            {
                return(new ListInscription(Table));
            }
            else
            {
                return(null);
            }
        }
Пример #7
0
        public static Inscription SelectById(string Id)
        {
            string       StrSQL  = "SELECT * FROM Inscription WEHRE Id = @Id";
            SqlCeCommand Command = new SqlCeCommand(StrSQL, Program.cnn);

            Command.Parameters.Add("@Id", SqlDbType.NVarChar).Value = Id;
            DataTable dt = DataBaseAccessUtilities.SelectRequest(Command);

            if (dt != null && dt.Rows.Count != 0)
            {
                return(new Inscription(dt.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Пример #8
0
        public static DataTable SelectInscriptionByCin(string cin)
        {
            string       StrSQL  = "SELECT AnneeUniversitaire,Niveau FROM Inscription WHERE Cin=@Cin";
            SqlCeCommand Command = new SqlCeCommand(StrSQL, Program.cnn);

            Command.Parameters.Add("@Cin", SqlDbType.NVarChar).Value = cin;
            DataTable Table = DataBaseAccessUtilities.SelectRequest(Command);

            if (Table != null)
            {
                return(Table);
            }
            else
            {
                return(null);
            }
        }
Пример #9
0
        public static ListInscription SelectByCIN(string Cin)
        {
            string       StrSQL  = "SELECT * FROM Inscription WHERE Cin= @Cin";
            SqlCeCommand Command = new SqlCeCommand(StrSQL, Program.cnn);

            Command.Parameters.Add("@Cin", SqlDbType.NVarChar).Value = Cin;
            DataTable Table = DataBaseAccessUtilities.SelectRequest(Command);

            if (Table != null && Table.Rows.Count != 0)
            {
                return(new ListInscription(Table));
            }
            else
            {
                return(null);
            }
        }
Пример #10
0
        public static ListFicheInformations SelectByCriterium(string FieldName, SqlDbType FieldType, string FieldValue)
        {
            string       request = "SELECT * FROM FicheInformation where " + FieldName + " = @" + FieldName;
            SqlCeCommand Command = new SqlCeCommand(request, Program.cnn);

            Command.Parameters.Add("@" + FieldName, FieldType).Value = FieldValue;
            DataTable Table = DataBaseAccessUtilities.SelectRequest(Command);

            if (Table != null && Table.Rows.Count != 0)
            {
                return(new ListFicheInformations(Table));
            }
            else
            {
                return(null);
            }
        }
Пример #11
0
 public static Article SelectById(int EntityKey)
 {
     using (SqlConnection con = DbConnection.GetConnection())
     {
         con.Open();
         string     StrSQL  = "SELECT * FROM Article WHERE Id = @EntityKey";
         SqlCommand command = new SqlCommand(StrSQL, con);
         command.Parameters.AddWithValue("@EntityKey", EntityKey);
         DataTable dt = DataBaseAccessUtilities.SelectRequest(command);
         if (dt != null && dt.Rows.Count != 0)
         {
             return(GetEntityFromDataRow(dt.Rows[0]));
         }
         else
         {
             return(null);
         }
     }
 }