internal static TransHedList GetTransHedList(Context ctx) { TransHedList headers = new TransHedList(); using (IConnection conn = Sync.GetConnection(ctx)) { IPreparedStatement ps = conn.PrepareStatement(@" SELECT rtrans_hed.id, rtrans_hed.cust_id, trans_date, docnum, htrn_explanation, rcustomer.cst_desc FROM rtrans_hed LEFT OUTER JOIN rcustomer ON rcustomer.id = rtrans_hed.cust_id "); IResultSet result = ps.ExecuteQuery(); while (result.Next()) { TransHed header = new TransHed(); header.Fetch(result); headers.Add(header); } result.Close(); ps.Close(); foreach (TransHed h in headers) { TransHed.FetchDetails(h, conn); } conn.Release(); } return(headers); }
public TransHedAdapter(Activity context, Library.TransHedList list) : base(context, Resource.Layout.TransHedRow, list) { this.context = context; TransHedList = list; }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); if (savedInstanceState != null) { _currentObjId = savedInstanceState.GetInt("idLvl2", -1); } ListView.ChoiceMode = ChoiceMode.Single; switch (ParentObjId) { case (int)MainMenu.MenuItems.Items: actionBar.SetTitle(this.Activity.GetString(Resource.String.miItems)); Library.ItemInfoList itemInfoList = new RetailMobile.Library.ItemInfoList(); //Library.ItemInfoList itemInfoList = Library.ItemInfoList.GetItemInfoList(this.Activity); _list = itemInfoList; ListAdapter = new ItemsInfoAdapter(Activity, itemInfoList); ((IScrollLoadble)ListAdapter).LoadData(0); //Library.ItemInfoList.LoadAdapterItems(this.Activity, (ItemsInfoAdapter)ListAdapter); break; case (int)MainMenu.MenuItems.Customers: actionBar.SetTitle(this.Activity.GetString(Resource.String.miCustomers)); Library.CustomerInfoList custInfoList = Library.CustomerInfoList.GetCustomerInfoList(this.Activity, new Library.CustomerInfoList.Criteria()); _list = custInfoList; ListAdapter = new CustomersAdapter(Activity, custInfoList); break; case (int)MainMenu.MenuItems.Invoices: actionBar.SetTitle(this.Activity.GetString(Resource.String.miInvoice)); Library.TransHedList thedList = Library.TransHedList.GetTransHedList(this.Activity); _list = thedList; ListAdapter = new TransHedAdapter(Activity, thedList); break; } }