Beispiel #1
0
        public static bool GetAuth(string Name, string NameP)
        {
            var command = new SqlCommand("uspAuth", DbsConnections.SqlBCApp)
            {
                CommandType = CommandType.StoredProcedure
            };

            command.Parameters.Add(DbsSqlParams.Direct("@Name", SqlDbType.VarChar, Name));
            command.Parameters.Add(DbsSqlParams.Direct("@NameP", SqlDbType.VarChar, NameP));

            return(DbsSqlOperations.GetInt(command) == 1);
        }
Beispiel #2
0
        public List <Exam.Entities.Product> Retrive()
        {
            var command = new SqlCommand("uspProducts", DbsConnections.SqlBCApp)
            {
                CommandType = CommandType.StoredProcedure
            };

            var result = DbsSqlOperations.GetDataSet(command).Tables[0].AsEnumerable()
                         .Select(dataRow => new Exam.Entities.Product
            {
                IdProduct = dataRow.Field <int>("IdProduct"),
                Product1  = dataRow.Field <string>("Product"),
                Cost      = dataRow.Field <double>("Cost"),
                Inventary = dataRow.Field <int>("Inventary")
            }).ToList();



            return(result);
        }