Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult ImportListByVesselVoyage()
- {
- return View();
- }
- [HttpPost]
- public ActionResult ImportListByVesselVoyage(WebTrackParam param)
- {
- client = new HttpClient();
- List<ImportListByVesselVoyageGetILBV> appMenu = new List<ImportListByVesselVoyageGetILBV>();
- client.BaseAddress = new Uri(url);
- MediaTypeWithQualityHeaderValue contentType = new MediaTypeWithQualityHeaderValue("application/json");
- client.DefaultRequestHeaders.Accept.Add(contentType);
- try
- {
- HttpResponseMessage response = client.GetAsync(string.Format("/Services/WebTrack.svc/ImportListByVesselVoyageGetILBVJSONData/{0}/{1}/{2}/{3}/{4}/{5}/{6}/{7}/{8}/{9}/{10}", "VR", "2018", param.reg, " ", " ", "A", "A", "S,Y,D", "F,L,E,T", "ITTEST", "2")).Result;
- if (response.IsSuccessStatusCode)
- {
- var stringData = response.Content.ReadAsStringAsync().Result;
- JObject result = JObject.Parse(stringData);
- var appMenuarray = result["ImportListByVesselVoyageGetILBVResult"].Value<JArray>();
- appMenu = appMenuarray.ToObject<List<ImportListByVesselVoyageGetILBV>>();
- ViewBag.ILBV = appMenu;
- }
- return View();
- }
- catch (Exception ex)
- {
- return PartialView("ImportListByVesselVoyage", appMenu);
- }
- finally
- {
- client.Dispose();
- client = null;
- }
- }
- @using (Html.BeginForm("ImportListByVesselVoyage", "Containerized", FormMethod.Post))
- {
- <div class="box-body">
- <div class="form-group">
- <div class="col-sm-6">
- @Html.TextBoxFor(model => model.reg)
- </div>
- </div>
- </div>
- <div class="box-footer">
- <button type="submit" class="btn btn-info pull-right"><i class="fa fa-search"></i>Search</button>
- </div>
- <div id="result">
- <div class="col-md-12">
- <div class="box">
- <div class="box-body no-padding">
- <table class="table table-striped">
- <tbody>
- <tr>
- <th>Container No.</th>
- <th>Operator</th>
- <th>Status</th>
- <th>Size</th>
- <th>Commodity</th>
- <th>Destination</th>
- <th>Location</th>
- <th>Discharged</th>
- <th>Delivered</th>
- </tr>
- @foreach (var item in ViewBag.ILBV)
- {
- <tr>
- <td>@item.ContainerNo</td>
- <td>@item.Operator</td>
- <td>@item.Status</td>
- <td>@item.Size</td>
- <td>@item.Commodity</td>
- <td>@item.Destination</td>
- <td>@item.Location</td>
- <td>@item.Discharged</td>
- <td>@item.Delivered</td>
- </tr>
- }
- </tbody>
- </table>
- </div>
- <div class="box-footer clearfix">
- <ul class="pagination pagination-sm no-margin pull-right"></ul>
- </div>
- </div>
- </div>
Add Comment
Please, Sign In to add comment