public override void OnBackPressed() { var member = ConMember.GetListSingle("select * from tblmember where address_id='" + Intent.GetStringExtra("address_id") + "'"); var house = ConHousing.GetListSingle("select * from tblHousing where address_id='" + Intent.GetStringExtra("address_id") + "'"); if (member != null && house != null) { ConAddress.GetListupdate("update tblAddressList set status='Done' where id='" + Intent.GetStringExtra("address_id") + "'"); } else { ConAddress.GetListupdate("update tblAddressList set status='Open' where id='" + Intent.GetStringExtra("address_id") + "'"); } var intent = new Intent(); intent.SetClass(this, typeof(ActAddress)); StartActivity(intent); }
private void Save_success(object sender, DialogClickEventArgs args) { var member = ConMember.GetListSingle("select * from tblmember where address_id='" + Intent.GetStringExtra("address_id") + "'"); var house = ConHousing.GetListSingle("select * from tblHousing where address_id='" + Intent.GetStringExtra("address_id") + "'"); if (member != null && house != null) { ConAddress.GetListupdate("update tblAddressList set status='Done' where id='" + Intent.GetStringExtra("address_id") + "'"); } else { ConAddress.GetListupdate("update tblAddressList set status='Open',sync='0' where id='" + Intent.GetStringExtra("address_id") + "'"); } var intent = new Intent(); intent.PutExtra("address_id", Intent.GetStringExtra("address_id")); intent.PutExtra("fulladdress", Intent.GetStringExtra("fulladdress")); intent.SetClass(this, typeof(ActAddress)); StartActivity(intent); }
public override View GetView(int position, View convertView, ViewGroup parent) { LinearLayout view; tblAddressList item; CheckBox chkbox; item = _items.ElementAt(position); view = (convertView ?? _context.LayoutInflater.Inflate(Resource.Layout.LayAddressLists, parent, false) ) as LinearLayout; view.FindViewById <TextView>(Resource.Id.lvladdress).Text = item.building_no + ", " + item.barangay + ", " + item.city + ", " + item.province + "."; view.FindViewById <TextView>(Resource.Id.lvlfullname).Text = item.fname + " " + item.lname; view.FindViewById <TextView>(Resource.Id.lvlstatus).Text = item.status; chkbox = view.FindViewById <CheckBox> (Resource.Id.checkBox1); if (item.status != "Done") { chkbox.Visibility = ViewStates.Invisible; } if (item.sync == "1") { chkbox.Checked = true; } chkbox.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked.Equals(true)) { ConAddress.GetListupdate("update tblAddressList set sync='1' where id='" + item.id + "'"); } else { ConAddress.GetListupdate("update tblAddressList set sync='0' where id='" + item.id + "'"); } }; return(view); }