/* * id=1 * dish_name=asdfasdfere * charge_sum=123 * is_vege=PURE * is_idle=false * daily_limit=1000 */ public void Upload(UpdateProgress invoker) { List <Dictionary <string, string> > suffix = new List <Dictionary <string, string> >(); List <List <string> > data = excel.GetRow(); foreach (List <string> row in data) { string id = row[0]; if (!id.All(char.IsDigit)) { continue; } string dname = row[1]; string charge = row[2]; string vege = (row[3] == "葷" ? "MEAT" : "PURE"); string idle = (row[4] == "是" ? "true" : "false"); string limit = row[5]; suffix.Add(new Dictionary <string, string> { { "id", WebUtility_Extend.UrlEncode(id) }, { "dish_name", WebUtility_Extend.UrlEncode(dname) }, { "charge_sum", WebUtility_Extend.UrlEncode(charge) }, { "is_vege", WebUtility_Extend.UrlEncode(vege) }, { "is_idle", WebUtility_Extend.UrlEncode(idle) }, { "daily_limit", WebUtility_Extend.UrlEncode(limit) } }); } req.Update_Dish(suffix, invoker); }
/* * id=1 * dish_name=asdfasdfere * charge_sum=123 * is_vege=PURE * is_idle=false * daily_limit=1000 */ public void Upload(UpdateProgress invoker) { List <string> suffix = new List <string>(); List <List <string> > data = excel.GetRow(); foreach (List <string> row in data) { string id = row[0]; if (!id.All(char.IsDigit)) { continue; } string dname = row[1]; string charge = row[2]; string vege = (row[3] == "葷" ? "MEAT" : "PURE"); string idle = (row[4] == "是" ? "true" : "false"); string limit = row[5]; suffix.Add("&id=" + WebUtility.UrlEncode(id) + "&dish_name=" + WebUtility.UrlEncode(dname) + "&charge_sum=" + WebUtility.UrlEncode(charge) + "&is_vege=" + WebUtility.UrlEncode(vege) + "&is_idle=" + WebUtility.UrlEncode(idle) + "&daily_limit=" + WebUtility.UrlEncode(limit)); } req.Update_Dish(suffix, invoker); }