Exemple #1
0
        /// <summary>
        /// 查看购物车
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static List <Details> GetDetails(UserLogin user)
        {
            string         str     = "select d.*from Details d join UserLogin u  on d.UserAccount = u.UserAccount where u.UserAccount = @UserName,e and u.UserPassword=@UserPassword  and PayState=0";
            List <Details> details = new List <Details>();

            SqlParameter[] p  = { new SqlParameter("@UserName", user.UserAccount), new SqlParameter("@UserPassword", user.USerPassword) };
            SqlDataReader  dr = DbHelp.ExecuteDataReader(str, p);
            Details        da = null;

            while (dr.Read())
            {
                da               = new Details();
                da.DetailsID     = (int)dr["DetailsID"];
                da.ID            = (int)dr["ID"];
                da.FlowerName    = dr["FlowerName"] as string;
                da.FlowerColor   = dr["FlowerColor"] as string;
                da.DetailsNumber = (int)dr["DetailsNumber"];    //数量
                da.FlowerPrice   = (float)dr["FlowerPrice"];    //单价li
                da.UserAccount   = dr["UserAccount"] as string; //账户
                da.FlowerPicUrl  = dr["FlowerPrice"] as string;
                da.FlowerSize    = dr["FlowerSize"] as string;
                da.Discount      = (decimal)dr["Discount"];
                da.PayState      = (int)dr["PayState"];
                da.PayDesc       = dr["DetailsPrice"] as string;
                details.Add(da);
            }
            dr.Close();
            return(details);
        }
Exemple #2
0
        /// <summary>
        /// 查询所有的商品
        /// </summary>
        /// <param name="old"></param>
        /// <returns></returns>
        public static List <FlowerNew> GetFlowerNew(string str)
        {
            List <FlowerNew> flo    = new List <FlowerNew>();
            SqlDataReader    dr     = DbHelp.ExecuteDataReader(str);
            FlowerNew        flower = null;

            while (dr.Read())
            {
                flower                 = new FlowerNew();
                flower.FlowerColor     = dr["FlowerColor"] as string;
                flower.FlowerDesc      = dr["FlowerDesc"] as string;
                flower.FlowerID        = (int)dr["FlowerID"];
                flower.FlowerLang      = dr["FlowerLang"] as string;
                flower.FlowerMaterials = dr["FlowerMaterials"] as string;
                flower.FlowerName      = dr["FlowerName"] as string;
                flower.FlowerNum       = (int)dr["FlowerNum"];
                flower.FlowerPicUrl    = dr["FlowerPicUrl"] as string;
                flower.FlowerPrice     = (decimal)dr["FlowerPrice"];
                flower.FlowerSize      = dr["FlowerSize"] as string;
                flower.FlowerState     = dr["FlowerState"] as string;
                flower.TypeID          = (int)dr["TypeID"];
                flo.Add(flower);
            }
            dr.Close();
            return(flo);
        }
Exemple #3
0
        /// <summary>
        /// 颜色
        /// </summary>
        /// <returns></returns>
        public static List <Colors> GetColors()
        {
            List <Colors> co  = new List <Colors>();
            string        str = "select * from Colors";
            SqlDataReader dr  = DbHelp.ExecuteDataReader(str);

            while (dr.Read())
            {
                co.Add(new Colors()
                {
                    ID = (int)dr["ColorID"], ColorName = dr["ColorName"] as string
                });
            }
            dr.Close();
            return(co);
        }
Exemple #4
0
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="acc"></param>
        /// <param name="where"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static List <UserLogin> GetLogin(string where = null)
        {
            string           str = "select * from UserLogin" + where;
            List <UserLogin> lo  = new List <UserLogin>();
            SqlDataReader    dr  = DbHelp.ExecuteDataReader(str);

            if (dr != null)
            {
                while (dr.Read())
                {
                    lo.Add(new UserLogin(dr["UserAccount"] as string, dr["UserName"] as string, dr["USerPassword"] as string, dr["UserSex"]  as string));
                }
                dr.Close();
            }

            return(lo);
        }
Exemple #5
0
        public static List <FlowerType> GetFLowerType()
        {
            List <FlowerType> ty  = new List <FlowerType>();
            string            str = "select * from FlowerType";
            SqlDataReader     dr  = DbHelp.ExecuteDataReader(str);
            FlowerType        flo = null;

            while (dr.Read())
            {
                flo          = new FlowerType();
                flo.TypeName = dr["TypeName"] as string;
                flo.TypeID   = (int)dr["TypeID"];
                ty.Add(flo);
            }
            dr.Close();
            return(ty);
        }