Exemple #1
0
        //获取菜单
        public static List <ConsumerDetails> GetCD(int TableID)
        {
            string sql = @"proc_GetCB";

            SqlParameter[] sp =
            {
                new SqlParameter("@TableID", TableID)
            };
            SqlDataReader          dr   = DBhelper.MySqlDataReaderProc(sql, sp);
            List <ConsumerDetails> list = new List <ConsumerDetails>();

            while (dr.Read())
            {
                ConsumerDetails cb = new ConsumerDetails();
                cb.TableID      = Convert.ToInt32(dr[0]);
                cb.ProductName  = dr[1].ToString();
                cb.CDAmount     = Convert.ToInt32(dr[2]);
                cb.ProductPrice = Convert.ToDouble(dr[3]);
                cb.CBID         = dr[4].ToString();
                cb.CBDate       = dr[6].ToString();
                cb.CBJE         = Convert.ToInt32(dr[2]) * Convert.ToDouble(dr[3]);
                cb.ProductID    = dr[7].ToString();
                list.Add(cb);
            }
            dr.Close();
            return(list);
        }