public static Mutuels ListOfMutuels() { Mutuels mutuels = new Mutuels(); List <Mutuel> muts = new List <Mutuel>(); try { using (var client = CommonUtility.GetHttpConnection("MutuelleSmartAPI")) { var URL = new Uri(client.BaseAddress, "Mutuels"); var response = client.GetAsync(URL.ToString()).Result; if (response.StatusCode == System.Net.HttpStatusCode.OK) { mutuels.status = 200; var result = response.Content.ReadAsStringAsync().Result; try { JsonConvert.DeserializeObject <USSD.Entities.Mutuels>(result).mutuels.ForEach(n => muts.Add(new Mutuel { mutuel_id = n.mutuel_id, mutuel_name = n.mutuel_name, commune_id = n.commune_id, price = n.price, address_id = n.address_id })); } catch { } } } } catch (Exception exp) { mutuels.status = 200; muts.Add(new Mutuel { mutuel_id = 1, commune_id = 1, mutuel_name = "Kananga Mutuel", price = 2, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 2, commune_id = 1, mutuel_name = "Bakwetu Mutuel", price = 1, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 3, commune_id = 2, mutuel_name = "Bakwabo Mutuel", price = 1, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 4, commune_id = 4, mutuel_name = "Dawa Mutuel", price = 0.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 5, commune_id = 4, mutuel_name = "Dibindi Mutuel", price = 2, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 6, commune_id = 3, mutuel_name = "Bipemba Mutuel", price = 1 }); muts.Add(new Mutuel { mutuel_id = 7, commune_id = 5, mutuel_name = "Mutombo Mutuel", price = 2, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 8, commune_id = 5, mutuel_name = "Mavungu Mutuel", price = 1, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 9, commune_id = 10, mutuel_name = "Dimakewtu Mutuel", price = 0.3M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 10, commune_id = 10, mutuel_name = "Nzee Mutuel", price = 0.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 11, commune_id = 10, mutuel_name = "Sobongo Mutuel", price = 2 }); muts.Add(new Mutuel { mutuel_id = 12, commune_id = 10, mutuel_name = "Lukushi Mutuel", price = 1 }); muts.Add(new Mutuel { mutuel_id = 13, commune_id = 11, mutuel_name = "Gecamine Mutuel", price = 2 }); muts.Add(new Mutuel { mutuel_id = 14, commune_id = 11, mutuel_name = "Sedwe Mutuel", price = 1, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 15, commune_id = 11, mutuel_name = "SNCC Mutuel", price = 0.99M }); muts.Add(new Mutuel { mutuel_id = 16, commune_id = 16, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 17, commune_id = 16, mutuel_name = "Basankusu Mutuel", price = 2.0M }); muts.Add(new Mutuel { mutuel_id = 18, commune_id = 17, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 19, commune_id = 18, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 20, commune_id = 18, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 21, commune_id = 19, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 22, commune_id = 6, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 23, commune_id = 6, mutuel_name = "Mahiza Mutuel", price = 1.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 24, commune_id = 7, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 25, commune_id = 8, mutuel_name = "Kitoko Mutuel", price = 0.99M }); muts.Add(new Mutuel { mutuel_id = 26, commune_id = 12, mutuel_name = "Mahiza Mutuel", price = 0.5M }); muts.Add(new Mutuel { mutuel_id = 27, commune_id = 13, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 28, commune_id = 14, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 29, commune_id = 18, mutuel_name = "Kitoko Mutuel", price = 1.99M }); muts.Add(new Mutuel { mutuel_id = 30, commune_id = 19, mutuel_name = "Mahiza Mutuel", price = 1.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 31, commune_id = 20, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 32, commune_id = 21, mutuel_name = "Kitoko Mutuel", price = 1.99M }); muts.Add(new Mutuel { mutuel_id = 33, commune_id = 22, mutuel_name = "Mahiza Mutuel", price = 1.5M }); muts.Add(new Mutuel { mutuel_id = 34, commune_id = 23, mutuel_name = "Basankusu Mutuel", price = 2.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 35, commune_id = 24, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 36, commune_id = 25, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 37, commune_id = 26, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 38, commune_id = 27, mutuel_name = "Basankusu Mutuel", price = 2.0M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 39, commune_id = 28, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); muts.Add(new Mutuel { mutuel_id = 40, commune_id = 29, mutuel_name = "Mahiza Mutuel", price = 0.5M }); muts.Add(new Mutuel { mutuel_id = 41, commune_id = 30, mutuel_name = "Basankusu Mutuel", price = 2.0M }); muts.Add(new Mutuel { mutuel_id = 42, commune_id = 31, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); } mutuels.mutuels = muts; return(mutuels); }
public static Mutuels ListOfMutuels() { Mutuels mutuels = new Mutuels(); List <Mutuel> coms = new List <Mutuel>(); mutuels.status = 200; coms.Add(new Mutuel { mutuel_id = 1, commune_id = 1, mutuel_name = "Kananga Mutuel", price = 2, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 2, commune_id = 1, mutuel_name = "Bakwetu Mutuel", price = 1, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 3, commune_id = 2, mutuel_name = "Bakwabo Mutuel", price = 1, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 4, commune_id = 4, mutuel_name = "Dawa Mutuel", price = 0.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 5, commune_id = 4, mutuel_name = "Dibindi Mutuel", price = 2, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 6, commune_id = 3, mutuel_name = "Bipemba Mutuel", price = 1 }); coms.Add(new Mutuel { mutuel_id = 7, commune_id = 5, mutuel_name = "Mutombo Mutuel", price = 2, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 8, commune_id = 5, mutuel_name = "Mavungu Mutuel", price = 1, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 9, commune_id = 10, mutuel_name = "Dimakewtu Mutuel", price = 0.3M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 10, commune_id = 10, mutuel_name = "Nzee Mutuel", price = 0.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 11, commune_id = 10, mutuel_name = "Sobongo Mutuel", price = 2 }); coms.Add(new Mutuel { mutuel_id = 12, commune_id = 10, mutuel_name = "Lukushi Mutuel", price = 1 }); coms.Add(new Mutuel { mutuel_id = 13, commune_id = 11, mutuel_name = "Gecamine Mutuel", price = 2 }); coms.Add(new Mutuel { mutuel_id = 14, commune_id = 11, mutuel_name = "Sedwe Mutuel", price = 1, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 15, commune_id = 11, mutuel_name = "SNCC Mutuel", price = 0.99M }); coms.Add(new Mutuel { mutuel_id = 16, commune_id = 16, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 17, commune_id = 16, mutuel_name = "Basankusu Mutuel", price = 2.0M }); coms.Add(new Mutuel { mutuel_id = 18, commune_id = 17, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 19, commune_id = 18, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 20, commune_id = 18, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 21, commune_id = 19, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 22, commune_id = 6, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 23, commune_id = 6, mutuel_name = "Mahiza Mutuel", price = 1.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 24, commune_id = 7, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 25, commune_id = 8, mutuel_name = "Kitoko Mutuel", price = 0.99M }); coms.Add(new Mutuel { mutuel_id = 26, commune_id = 12, mutuel_name = "Mahiza Mutuel", price = 0.5M }); coms.Add(new Mutuel { mutuel_id = 27, commune_id = 13, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 28, commune_id = 14, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 29, commune_id = 18, mutuel_name = "Kitoko Mutuel", price = 1.99M }); coms.Add(new Mutuel { mutuel_id = 30, commune_id = 19, mutuel_name = "Mahiza Mutuel", price = 1.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 31, commune_id = 20, mutuel_name = "Basankusu Mutuel", price = 1.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 32, commune_id = 21, mutuel_name = "Kitoko Mutuel", price = 1.99M }); coms.Add(new Mutuel { mutuel_id = 33, commune_id = 22, mutuel_name = "Mahiza Mutuel", price = 1.5M }); coms.Add(new Mutuel { mutuel_id = 34, commune_id = 23, mutuel_name = "Basankusu Mutuel", price = 2.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 35, commune_id = 24, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 36, commune_id = 25, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 37, commune_id = 26, mutuel_name = "Mahiza Mutuel", price = 0.5M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 38, commune_id = 27, mutuel_name = "Basankusu Mutuel", price = 2.0M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 39, commune_id = 28, mutuel_name = "Kitoko Mutuel", price = 0.99M, address_id = 2 }); coms.Add(new Mutuel { mutuel_id = 40, commune_id = 29, mutuel_name = "Mahiza Mutuel", price = 0.5M }); coms.Add(new Mutuel { mutuel_id = 41, commune_id = 30, mutuel_name = "Basankusu Mutuel", price = 2.0M }); coms.Add(new Mutuel { mutuel_id = 42, commune_id = 31, mutuel_name = "Kitoko Mutuel", price = 1.99M, address_id = 2 }); mutuels.mutuels = coms; return(mutuels); }