Exemplo n.º 1
0
        public static TPotDishInfo parseonlyPot(JObject ja)
        {
            TPotDishInfo potInfo = new TPotDishInfo();

            potInfo.PotDish = parseonly(ja, false);
            JArray jrDishs = (JArray)ja["dishes"];

            for (int i = 0; i <= jrDishs.Count - 1; i++)
            {
                JObject ja1 = (JObject)jrDishs[i];
                if (ja1["ispot"].ToString().Equals("1"))
                {
                    potInfo.PotInfo = parseonly(ja1, false);
                }
                else
                {
                    if (potInfo.FishDishInfo1 == null)
                    {
                        potInfo.FishDishInfo1 = parseonly(ja1, false);
                    }
                    else
                    {
                        potInfo.FishDishInfo2 = parseonly(ja1, false);
                        break;
                    }
                }
            }
            return(potInfo);
        }
Exemplo n.º 2
0
        public static TPotDishInfo getPotDishInfo(string memberno, string dishid, JArray groupData)
        {
            TPotDishInfo potDishInfo = new TPotDishInfo();
            JObject      ja          = (JObject)groupData[0];
            string       ispot       = ja["ispot"].ToString();

            potDishInfo.potInfo       = ParseDishInfo(memberno, ja);
            potDishInfo.potInfo.IsPot = 1;
            potDishInfo.potInfo       = ParseDishInfo(memberno, ja);
            potDishInfo.memberno      = memberno;
            ja = (JObject)groupData[1];
            potDishInfo.fishDishInfo1 = ParseDishInfo(memberno, ja);
            if (groupData.Count > 2)
            {
                ja = (JObject)groupData[2];
                potDishInfo.fishDishInfo2 = ParseDishInfo(memberno, ja);
            }
            return(potDishInfo);
        }
Exemplo n.º 3
0
        public static TCombo parsecombo(JObject ja)
        {
            TCombo combo = new TCombo();

            combo.Startnum   = int.Parse(ja["startnum"].ToString());
            combo.Endnum     = int.Parse(ja["endnum"].ToString());
            combo.Status     = ja["status"].ToString();
            combo.Columnname = ja["columnname"].ToString();
            combo.Ordernum   = float.Parse(ja["ordernum"].ToString());
            combo.Columnid   = ja["columnid"].ToString();
            combo.Id         = ja["id"].ToString();
            combo.Dishid     = ja["dishid"].ToString();
            combo.ItemDesc   = ja["itemDesc"].ToString();
            JArray jr = (JArray)ja["alldishes"];

            for (int i = 0; i <= jr.Count - 1; i++)
            {
                JObject jacombo = (JObject)jr[i];
                string  dishes  = jacombo["dishes"].ToString();
                if (dishes == null)
                {
                    dishes = "";
                }
                if (dishes.Length > 0)
                {
                    //鱼锅
                    TPotDishInfo potinfo = parseonlyPot(jacombo);
                    combo.Dishs.Add(potinfo);
                }
                else
                {
                    t_shopping dishinfo = parseonly(jacombo, false);
                    combo.Dishs.Add(dishinfo);
                }
            }
            return(combo);
        }
Exemplo n.º 4
0
        public static TComboDish parse(JObject jaData)
        {
            TComboDish combodish = new TComboDish();
            JArray     jronly    = (JArray)jaData["only"];
            JArray     jrcombo   = (JArray)jaData["combo"];

            //必选
            for (int i = 0; i <= jronly.Count - 1; i++)
            {
                //如果是单品 dishes
                JObject ja     = (JObject)jronly[i];
                string  dishes = ja["dishes"].ToString();
                if (dishes == null)
                {
                    dishes = "";
                }
                if (dishes.Length > 0)
                {
                    //鱼锅
                    TPotDishInfo potinfo = parseonlyPot(ja);
                    combodish.Onlydishs.Add(potinfo);
                }
                else
                {
                    t_shopping dishinfo = parseonly(ja, false);
                    combodish.Onlydishs.Add(dishinfo);
                }
            }
            //几选几
            for (int i = 0; i <= jrcombo.Count - 1; i++)
            {
                TCombo combo = parsecombo((JObject)jrcombo[i]);
                combodish.Combodishs.Add(combo);
            }
            return(combodish);
        }