Beispiel #1
0
        public IHttpActionResult FindMembers()
        {
            List <member> members = memberDao.FindAll();

            if (members.Count > 0)
            {
                return(Ok(members));
            }

            //return Content(HttpStatusCode.NotFound, "Members not found");
            return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Members not found")));
        }
Beispiel #2
0
        public IList <Member> FindAll()
        {
            IList <Member>   list   = new List <Member>();
            IList <MemberBO> listBO = new List <MemberBO>();

            listBO = memberDao.FindAll();
            if (listBO != null && listBO.Count > 0)
            {
                foreach (MemberBO obj in listBO)
                {
                    list.Add(new Member(obj));
                }
            }
            return(list);
        }
        public ActionResult GetMembers()
        {
            if (Session["member"] is null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            List <member> members = memberDao.FindAll();

            if (members.Count == 0)
            {
                return(RedirectToAction("index"));
            }

            return(View(members));
        }