Example #1
0
        public async void DeleteAcount(UserInfo user)
        {
            BoardServerAccess   db_boardAccess   = new BoardServerAccess();
            MessageServerAccess db_messageAccess = new MessageServerAccess();

            List <MainBoard> boardList = await MobileService.GetTable <MainBoard>().Where(p => p.Creator == user.UserName).ToListAsync();

            foreach (MainBoard mb in boardList)
            {
                db_boardAccess.deleteBoard(mb.beaconID);
            }

            List <Message> messageList = await MobileService.GetTable <Message>().Where(p => p.Creator == user.UserName).ToListAsync();

            foreach (Message mes in messageList)
            {
                db_messageAccess.deleteMessage(mes.id);
            }
            List <ReplyMessage> replyList = await MobileService.GetTable <ReplyMessage>().Where(p => p.Creator == user.UserName).ToListAsync();

            foreach (ReplyMessage rmes in replyList)
            {
                db_messageAccess.deleteReplyMessage(rmes.id);
            }

            await MobileService.GetTable <UserInfo>().DeleteAsync(user);
        }
        protected async override void OnStart()
        {
            base.OnStart();
            db_accessBoard   = new BoardServerAccess();
            db_accessMessage = new MessageServerAccess();

            if (typeOfBoard.Equals("MainBoard"))
            {
                createMessageButton.Visibility = ViewStates.Visible;
                if (!beaconId.Equals(""))
                {
                    messageList = await db_accessMessage.getMainBoardMessages(beaconId);
                }
                MainBoard mb = await db_accessBoard.returnMainBoard(beaconId);

                boardCreator = mb.Creator;

                if (boardCreator.Equals(username))
                {
                    delteBoardButton.Visibility = ViewStates.Visible;
                }


                messageListview.Adapter = new MessageAdapter(this, messageList);
            }


            if (typeOfBoard.Equals("ReplyBoard"))
            {
                messageList = new List <Message>();
                if (!parentMessageID.Equals(""))
                {
                    replyMessageList = await db_accessMessage.getReplyMessages(parentMessageID);
                }

                foreach (ReplyMessage rm in replyMessageList)
                {
                    messageList.Add(rm.ReturnBase());
                }

                messageListview.Adapter = new MessageAdapter(this, messageList);
            }

            if (typeOfBoard.Equals("UserBoard"))
            {
                messageList = new List <Message>();
                {
                    messageList = await db_accessMessage.getUserMessages(username);
                }

                messageListview.Adapter = new MessageAdapter(this, messageList);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.beacons);
            viewList    = FindViewById <ListView>(Resource.Id.beaconList);
            beaconsList = new Dictionary <string, string>();

            db_accessBoard = new BoardServerAccess();

            beaconStatus      = FindViewById <TextView>(Resource.Id.beaconId);
            beaconStatus.Text = "Finding beacons...";

            viewList.ItemClick += ViewList_ItemClick;

            // Create your application here
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.createBoard);

            username = Intent.GetStringExtra("_username");
            beaconId = Intent.GetStringExtra("_beaconID");

            db_accessBoard    = new BoardServerAccess();
            createBoardButton = FindViewById <Button>(Resource.Id.b_boardCreateOK);
            cancelButton      = FindViewById <Button>(Resource.Id.b_boardCreateCancel);
            isPrivateCheckbox = FindViewById <CheckBox>(Resource.Id.cb_boardCreateIsProtected);
            boardPassword     = FindViewById <EditText>(Resource.Id.et_boardCreatePassword);
            boardTitle        = FindViewById <EditText>(Resource.Id.et_boardCreateTitle);
            passwordText      = FindViewById <TextView>(Resource.Id.tv_createBoardPassword);

            boardPassword.Visibility = ViewStates.Invisible;
            passwordText.Visibility  = ViewStates.Invisible;

            isPrivateCheckbox.Click += IsPrivateCheckbox_Click;
            //cancelButton.Click += CancelButton_Click;
            createBoardButton.Click += CreateBoardButton_Click;
        }