private async void YesDialog_Clicked(object sender, DialogClickEventArgs args) { var progressDialog = ProgressDialog.Show(this, "Please wait... ", "Updating Po...", true); try { var updateupc = ((WMSApplication)Application).ItemRepository.UpdateRPoListDetail(Intent.GetStringExtra("receiver_num"), Intent.GetStringExtra("division_id")); foreach (var i in updateupc) { if (Convert.ToInt32(i.oqty) != 0) { await(ApiConnection1.ApiDebsUpdateData(GlobalVariables.GlobalUrl + "/RPoListDetailUpdate/" + i.receiver_num + "/" + i.division_id + "/" + i.upc + "/" + i.rqty + "/qwde")); } else { await(ApiConnection1.ApiDebsUpdateData(GlobalVariables.GlobalUrl + "/RPoListDetailAdd/" + i.receiver_num + "/" + i.division_id + "/" + i.upc + "/" + i.rqty + "/" + txtslot.Text + "/" + GlobalVariables.GlobalUserid)); } } //await (ApiConnection1.ApiDebsUpdateData (GlobalVariables.GlobalUrl + "RPoListUpdate/"+)); tblPoList item = new tblPoList(); var polist = ((WMSApplication)Application).ItemRepository.GetRPoListFirst(Intent.GetStringExtra("receiver_num"), Intent.GetStringExtra("division_id")); item.id = polist.id; ((WMSApplication)Application).ItemRepository.DeleteRPoList(item); progressDialog.Cancel(); var builder = new AlertDialog.Builder(this); builder.SetTitle("Debenhams"); builder.SetMessage("PO Successfully Closed"); builder.SetPositiveButton("OK", Closed_Clicked); builder.Show(); } catch (Exception ex) { progressDialog.Cancel(); Toast.MakeText(this, "Unable To Update Po.\n" + ex.Message, ToastLength.Long).Show(); } }
public long DeleteRPoList(tblPoList item) { using (var database = WMSDatabase.NewConnection()) { database.Delete(item); return(item.id); } }
public List <tblPoList> GetRPoList(string po) { tblPoList itemlist = new tblPoList(); using (var database = WMSDatabase.NewConnection()) { return(database .Table <tblPoList>().ToList() .Where(t => t.po_num.Contains(po)).ToList()); } }