public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath) { if(editingStyle == UITableViewCellEditingStyle.Delete) { CodeProjectMember memberToDelete = MemberList [indexPath.Row]; CodeProjectDatabase database = new CodeProjectDatabase (); database.DeleteMember (memberToDelete.Id); MemberList = database.GetMembers(); tableView.ReloadData (); } }
public override bool OnContextItemSelected (IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; CodeProjectMember memberToDelete = members [info.Position]; CodeProjectDatabase db = new CodeProjectDatabase (); db.DeleteMember (memberToDelete.Id); members = db.GetMembers (); ListAdapter = new CodeProjectMemberAdapter (this.Activity, members); return true; }
public void DeleteMember(string memberId) { CodeProjectDatabase db = new CodeProjectDatabase(); db.DeleteMember(int.Parse(memberId)); Load(); }