How to get the bonded data in the Model to code behind

Hi ,
I have a separate model to get the ticket id from the SQLserver as below ( i am getting data from PHP as json object)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestProject.Data
{
public class TiketViewModel
{
public int TiketNumb { get; set; }
public int FlagNum { get; set; }
}

public class JsonTicketNewNum
{
    public List<TiketViewModel>TicketInfo { get; set; }
}

}

and i get the data through the model by using post async ( i am sending the location id and table id as inputs to retrieve the ticket id from the sql server)

public async void GetTicketinfo()
{
string LocationId = "1";
var client = new HttpClient();
var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("LocationId", LocationId));
postData.Add(new KeyValuePair<string, string>("TableID", count));////////
var content = new FormUrlEncodedContent(postData);
// var response = await client.PostAsync("http://192.168.43.226/GetTicket.php", content);
var response = await client.PostAsync(Constants.BaseUrlpos + "GetTicket.php", content);
string JsonTiket = response.Content.ReadAsStringAsync().Result;
// string JsonTikettwo = response.Content.ReadAsStringAsync().Result;
// TicketModel ObjContactList = new TicketModel();
TiketViewModel ObjContactList = new TiketViewModel();
if (response.IsSuccessStatusCode)
{
// ObjContactList = JsonConvert.DeserializeObject(JsonTiket);
// var items = ObjContactList.TiketNumb;
//// var itemstwo = ObjContactList.FlagNum;
}

my problem is how do i filter "TiketNumb" and "FlagNum" from the blinded data set i retrieve in the code behind .
thanks In advance for your support .
Pan

Sign In or Register to comment.