Ejemplo n.º 1
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <Delivery> GetList(int page, int index)
        {
            string          sql  = $"{CreateSqlString.SelectSqlString(new Delivery { }) }limit  {((page - 1) * index)}, {index}";
            DataTable       da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Delivery> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Delivery>();
                Delivery Delivery = null;
                foreach (DataRow row in da.Rows)
                {
                    Delivery = new Delivery();
                    LoadEntity(Delivery, row);
                    list.Add(Delivery);
                }
            }
            return(list);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取一条用户信息 By ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Delivery GetDeail(int id)
        {
            string sql = $"{ CreateSqlString.SelectSqlString(new Delivery { })} WHERE DeliveryId =@DeliveryId ";

            MySqlParameter[] pars =
            {
                new MySqlParameter("@DeliveryId", SqlDbType.Int)
            };
            pars[0].Value = id;
            DataTable dt       = SqlHelper.GetDataTable(sql, CommandType.Text, pars);
            Delivery  instance = null;

            if (dt.Rows.Count > 0)
            {
                instance = new Delivery();
                LoadEntity(instance, dt.Rows[0]);
            }
            return(instance);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <Product> GetList(int page, int index)
        {
            string         sql  = $"{CreateSqlString.SelectSqlString(new Product { }) }limit  {((page - 1) * index)}, {index}";
            DataTable      da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Product> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Product>();
                Product Product = null;
                foreach (DataRow row in da.Rows)
                {
                    Product = new Product();
                    LoadEntity(Product, row);
                    list.Add(Product);
                }
            }
            return(list);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <AdminUser> GetList(int page, int index)
        {
            string           sql  = $"{CreateSqlString.SelectSqlString(new AdminUser { }) }limit  {((page - 1) * index)}, {index}";
            DataTable        da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <AdminUser> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <AdminUser>();
                AdminUser AdminUser = null;
                foreach (DataRow row in da.Rows)
                {
                    AdminUser = new AdminUser();
                    LoadEntity(AdminUser, row);
                    list.Add(AdminUser);
                }
            }
            return(list);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <Orders> GetList(int page, int index)
        {
            string        sql  = $"{CreateSqlString.SelectSqlString(new Orders { }) }limit  {((page - 1) * index)}, {index}";
            DataTable     da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Orders> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Orders>();
                Orders Orders = null;
                foreach (DataRow row in da.Rows)
                {
                    Orders = new Orders();
                    LoadEntity(Orders, row);
                    list.Add(Orders);
                }
            }
            return(list);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取一条用户信息 By ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Appraise GetDeail(int id)
        {
            string sql = CreateSqlString.SelectSqlString(new Appraise {
            }) + " WHERE AppraiseId =@AppraiseId ";

            SqlParameter[] pars =
            {
                new SqlParameter("@AppraiseId", SqlDbType.Int)
            };
            pars[0].Value = id;
            DataTable dt       = SqlHelper.GetDataTable(sql, CommandType.Text, pars);
            Appraise  instance = null;

            if (dt.Rows.Count > 0)
            {
                instance = new Appraise();
                LoadEntity(instance, dt.Rows[0]);
            }
            return(instance);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <Favorite> GetList(int page, int index)
        {
            string sql           = CreateSqlString.SelectSqlString(new Favorite {
            });                                                            //limit  {((page - 1) * index)}, {index}";
            DataTable       da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Favorite> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Favorite>();
                Favorite Favorite = null;
                foreach (DataRow row in da.Rows)
                {
                    Favorite = new Favorite();
                    LoadEntity(Favorite, row);
                    list.Add(Favorite);
                }
            }
            return(list);
        }
Ejemplo n.º 8
0
        ///// <summary>
        ///// 获取列表
        ///// </summary>
        ///// <returns></returns>
        //public List<Orders> UserOrderDetailJoin()
        //{
        //   string sql


        //    return null;
        //}



        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public List <Orders> GetList()
        {
            string sql         = CreateSqlString.SelectSqlString(new Orders {
            });
            DataTable     da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Orders> list = new List <Orders>();

            if (da.Rows.Count > 0)
            {
                list = new List <Orders>();
                Orders Orders = null;
                foreach (DataRow row in da.Rows)
                {
                    Orders = new Orders();
                    LoadEntity(Orders, row);
                    list.Add(Orders);
                }
            }
            return(list);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public List <Photo> GetList()
        {
            string sql        = CreateSqlString.SelectSqlString(new Photo {
            });
            DataTable    da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Photo> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Photo>();
                Photo Photo = null;
                foreach (DataRow row in da.Rows)
                {
                    Photo = new Photo();
                    LoadEntity(Photo, row);
                    list.Add(Photo);
                }
            }
            return(list);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public List <Detail> GetList()
        {
            string sql         = CreateSqlString.SelectSqlString(new Detail {
            });
            DataTable     da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Detail> list = null;

            if (da.Rows.Count > 0)
            {
                list = new List <Detail>();
                Detail Detail = null;
                foreach (DataRow row in da.Rows)
                {
                    Detail = new Detail();
                    LoadEntity(Detail, row);
                    list.Add(Detail);
                }
            }
            return(list);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <Appraise> GetList(int page, int index)
        {
            string sql           = CreateSqlString.SelectSqlString(new Appraise {
            });                                                             //}limit  {((page - 1) * index)}, {index}";
            DataTable       da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Appraise> list = new List <Appraise> {
            };

            if (da.Rows.Count > 0)
            {
                list = new List <Appraise>();
                Appraise Appraise = null;
                foreach (DataRow row in da.Rows)
                {
                    Appraise = new Appraise();
                    LoadEntity(Appraise, row);
                    list.Add(Appraise);
                }
            }
            return(list);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <returns></returns>
        public List <News> GetList(int page, int index)
        {
            string sql       = CreateSqlString.SelectSqlString(new News {
            });                                                        //+" limit "  +((page - 1) * index), {index}";
            DataTable   da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <News> list = new List <News> {
            };

            if (da.Rows.Count > 0)
            {
                list = new List <News>();
                News News = null;
                foreach (DataRow row in da.Rows)
                {
                    News = new News();
                    LoadEntity(News, row);
                    list.Add(News);
                }
            }
            return(list);
        }
Ejemplo n.º 13
0
        //public List<ProductEx> ProductJoinImage()
        //{
        //    string sql
        //}



        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public List <Product> GetList()
        {
            string sql          = CreateSqlString.SelectSqlString(new Product {
            });
            DataTable      da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Product> list = new List <Product> {
            };

            if (da.Rows.Count > 0)
            {
                list = new List <Product>();
                Product Product = null;
                foreach (DataRow row in da.Rows)
                {
                    Product = new Product();
                    LoadEntity(Product, row);
                    list.Add(Product);
                }
            }
            return(list);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <returns></returns>
        public List <Customer> GetList(int page, int index)
        {
            //string sql = $"select UserId,UserName,Pwd,Nick,Email,DeliveryId from Customer limit  {((page - 1) * index)}, {index}";
            string sql           = CreateSqlString.SelectSqlString(new Customer {
            });
            DataTable       da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <Customer> list = new List <Customer> {
            };

            if (da.Rows.Count > 0)
            {
                list = new List <Customer>();
                Customer Customer = null;
                foreach (DataRow row in da.Rows)
                {
                    Customer = new Customer();
                    LoadEntity(Customer, row);
                    list.Add(Customer);
                }
            }
            return(list);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public List <AdminUser> GetList()
        {
            string sql            = CreateSqlString.SelectSqlString(new AdminUser {
            });
            DataTable        da   = SqlHelper.GetDataTable(sql, CommandType.Text);
            List <AdminUser> list = new List <AdminUser> {
            };

            if (da.Rows.Count > 0)
            {
                list = new List <AdminUser>();
                AdminUser AdminUser = new AdminUser {
                };
                foreach (DataRow row in da.Rows)
                {
                    AdminUser = new AdminUser();
                    LoadEntity(AdminUser, row);
                    list.Add(AdminUser);
                }
            }
            return(list);
        }