示例#1
0
        private FoodShowItem JTokenToModel(JToken item)
        {
            Model.FoodShowItem oFoodShowItem = new Model.FoodShowItem();
            int count = int.Parse(item["count"].ToString());
            int rcount = int.Parse(item["rcount"].ToString());
            int fcount = int.Parse(item["fcount"].ToString());
            int id = int.Parse(item["id"].ToString());

            string name = item["name"].ToString() ?? "";
            string img = item["img"].ToString() ?? "";
            string food = item["food"].ToString() ?? "";
            string description = item["description"].ToString() ?? "";
            string keywords = item["keywords"].ToString() ?? "";
            string summary = item["summary"].ToString() ?? "";
            string disease = item["disease"].ToString() ?? "";

            oFoodShowItem.id = id;
            oFoodShowItem.count = count;
            oFoodShowItem.rcount = rcount;
            oFoodShowItem.fcount = fcount;
            oFoodShowItem.name = name;//名称
            oFoodShowItem.img = img;//图片
            oFoodShowItem.food = food;//食物
            oFoodShowItem.img = img;//图片,
            oFoodShowItem.description = description;//描述
            oFoodShowItem.keywords = keywords;//关键字
            oFoodShowItem.summary = summary;//资讯内容
            oFoodShowItem.disease = disease;

            return oFoodShowItem;
        }
示例#2
0
        private FoodShowItem JTokenToModel(JToken item)
        {
            Model.FoodShowItem oFoodShowItem = new Model.FoodShowItem();
            int count  = int.Parse(item["count"].ToString());
            int rcount = int.Parse(item["rcount"].ToString());
            int fcount = int.Parse(item["fcount"].ToString());
            int id     = int.Parse(item["id"].ToString());

            string name        = item["name"].ToString() ?? "";
            string img         = item["img"].ToString() ?? "";
            string food        = item["food"].ToString() ?? "";
            string description = item["description"].ToString() ?? "";
            string keywords    = item["keywords"].ToString() ?? "";
            string summary     = item["summary"].ToString() ?? "";
            string disease     = item["disease"].ToString() ?? "";

            oFoodShowItem.id          = id;
            oFoodShowItem.count       = count;
            oFoodShowItem.rcount      = rcount;
            oFoodShowItem.fcount      = fcount;
            oFoodShowItem.name        = name;        //名称
            oFoodShowItem.img         = img;         //图片
            oFoodShowItem.food        = food;        //食物
            oFoodShowItem.img         = img;         //图片,
            oFoodShowItem.description = description; //描述
            oFoodShowItem.keywords    = keywords;    //关键字
            oFoodShowItem.summary     = summary;     //资讯内容
            oFoodShowItem.disease     = disease;

            return(oFoodShowItem);
        }