Ejemplo n.º 1
0
        //View member Information
        private void dgvMember_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //【1】Gets the member details for the selected row
            Member objMember = null;

            try
            {
                objMember = objMemberServices.GetMemberById(dgvMember.CurrentRow.Cells[0].Value.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Abnormal access to selected member information! Specific reasons:" + ex.Message, "System Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            //【2】 Initialization of ActionFlag
            actionFlag = 1;

            //【3】 Loading a form
            if (objFrmMemberDetail == null)
            {
                objFrmMemberDetail = new frmMemberDetail(actionFlag, objMember);
                objFrmMemberDetail.Show();
            }
            else
            {
                objFrmMemberDetail.Activate();
                objFrmMemberDetail.WindowState = FormWindowState.Maximized;
            }
        }
Ejemplo n.º 2
0
        public IActionResult LoadGameSelectionpage()
        {
            int memberId = (int)HttpContext.Session.GetInt32("memberId");


            MemberServices ms = new MemberServices();

            Member member = ms.GetMemberById(memberId);

            if (member is null)
            {
                throw new Exception("did not get member from database");
            }

            if (member.OwnedGames is null)
            {
                member.OwnedGames = new List <Game>();
            }
            if (member.LikeToPlayGames is null)
            {
                member.LikeToPlayGames = new List <Game>();
            }

            member.OwnedGames = ms.GetMemberOwnedGames(memberId);



            GameChooseViewModel vm = new GameChooseViewModel();

            vm.member = member;
            return(View("GameSelectionPage", vm));
        }
Ejemplo n.º 3
0
 public IActionResult Delete(string id)
 {
     if (!id.Equals(""))
     {
         var _member = _memberServices.GetMemberById(id);
         if (_member != null)
         {
             _memberServices.DeleteMember(_member);
             _memberServices.Commit();
             return(Ok());
         }
         else
         {
             return(NotFound());
         }
     }
     else
     {
         return(BadRequest());
     }
 }