Beispiel #1
0
 public static foodItem getInstance() //싱글톤
 {
     if (instance == null)
     {
         instance = new foodItem();
     }
     return(instance);
 }
Beispiel #2
0
        public void itemlistCafe()
        {
            DataSet   dsCount  = dm.pcRoomCount("cafe");
            DataTable dtCount  = dsCount.Tables[0];
            int       menu_num = int.Parse(dtCount.Rows[0][0].ToString());

            DataSet   ds = dm.pcRoomBeta("where cafe=1");
            DataTable dt = ds.Tables[0];

            foodItem[] fItem = new foodItem[menu_num];

            for (int i = 0; i < menu_num; i++)
            {
                string menu_name  = dt.Rows[i][0].ToString();
                int    menu_price = int.Parse(dt.Rows[i][1].ToString());
                fItem[i] = new foodItem();

                fItem[i].initFoodInfo(menu_name, menu_price);

                itemListCafe.Controls.Add(fItem[i]);
            }
        }