示例#1
0
        public static List <Model.Lipstick> GetLipstick()   //查询商品
        {
            string                sql      = "select * from Lipstick";
            SqlDataReader         dr       = DBHpelp.ExecuteReader(sql);
            List <Model.Lipstick> Lipstick = new List <Model.Lipstick>();

            Model.Lipstick kso = null;
            while (dr.Read())
            {
                kso        = new Lipstick();
                kso.LipID  = (int)dr["LipID"];
                kso.Lphoto = dr["Lphoto"].ToString();
                kso.LTitle = dr["LTitle"].ToString();
                kso.LPrice = (decimal)dr["LPrice"];
                kso.LColor = dr["LColor"].ToString();
                Lipstick.Add(kso);
            }
            dr.Close();
            return(Lipstick);
        }
示例#2
0
 public int InsertLipstick(Model.Lipstick lipstick)  //添加商品
 {
     return(new DAL.LipstickDAL().InsertLipstick(lipstick));
 }
示例#3
0
 public int InsertLipstick(Model.Lipstick lipstick)  //添加商品
 {
     return(DBHpelp.ExecQuery("INSERT INTO Lipstick ('Lphoto','[LTitle]',[LPrice],'LColor')VALUES('" + lipstick.Lphoto + "','" + lipstick.LPrice + "','" + lipstick.LColor + "')"));
 }