Exemplo n.º 1
0
        public ActionResult Details(int?id)
        {
            Infor infor = inforRepo.Get(i => i.ID == id);

            if (infor == null)
            {
                return(HttpNotFound());
            }
            return(View(infor));
        }
Exemplo n.º 2
0
        public ActionResult Details(int?id)
        {
            Member member = memberRepo.Get(m => m.ID == id);

            if (member == null)
            {
                return(HttpNotFound());
            }
            return(View(member));
        }
Exemplo n.º 3
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            Feature feature = featRepo.Get(f => f.ID == id);

            if (feature == null)
            {
                return(HttpNotFound());
            }
            return(View(feature));
        }
Exemplo n.º 4
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LogRecord logRecord = logRecRepo.Get(r => r.ID == id);

            if (logRecord == null)
            {
                return(HttpNotFound());
            }
            return(View(logRecord));
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            ExportService <LogRecord> exportService = new ExportService <LogRecord>();

            ViewBag.ExportColumns = exportService.GetSelectList();

            string user = WebSiteHelper.UserName;

            ViewBag.Title = user;
            if (user == "admin")
            {
                ViewBag.Title = "會員";
                return(View(logRecRepo.GetAll()));
            }



            int memberId = memberRepo.Get(m => m.Name == user).ID;

            return(View(logRecRepo.GetAll().Where(r => r.MemberId == memberId).ToList()));
        }
Exemplo n.º 6
0
        private T GetFirst <T>() where T : EntityBase
        {
            var crud = new CrudRepository <T>(_uow);

            return(crud.Get().FirstOrDefault());
        }
Exemplo n.º 7
0
 public static async Task GetRecord()
 {
     var record = await repo.Get(1);
 }