示例#1
0
        public ActionResult <IEnumerable <Deapart> > selectto()
        {
            var Rather = new List <Deapart>();

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                SqlCommand command = new SqlCommand($"select * from Depart", connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    Rather.Add(HelperOper.ADONetToClass <Deapart>(reader));
                }
            }

            return(Ok(Rather));
        }
        public ActionResult <IEnumerable <Goods> > shopTow()
        {
            var Rather = new List <Goods>();

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                SqlCommand command = new SqlCommand($"select * from Goods a join GoodsType b on a.Id=b.TypeParentid where b.TypeName='男装'", connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    Rather.Add(HelperOper.ADONetToClass <Goods>(reader));
                }
            }
            dataFree = Rather.Count();
            return(Ok(dataFree));
        }
示例#3
0
        public ActionResult <IEnumerable <Man> > tool()
        {
            var Rather = new List <Man>();

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                SqlCommand command = new SqlCommand($"select * from Man join Depart on Man.Did=Depart.Did", connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    Rather.Add(HelperOper.ADONetToClass <Man>(reader));
                }
            }

            return(Ok(Rather));
        }
        public ActionResult <IEnumerable <UserInfo> > shopOne()
        {
            var Rather = new List <UserInfo>();

            using (SqlConnection connection = new SqlConnection(_connectionString))
            {
                SqlCommand command = new SqlCommand($"select * from UserInfo where sex='女'", connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    Rather.Add(HelperOper.ADONetToClass <UserInfo>(reader));
                }
            }
            dataFree = Rather.Count();
            return(Ok(dataFree));
        }