示例#1
0
        public InstroductionResponse GetInstroduction(int id)
        {
            var instroduction = _instroductionRepository.GetSingle(g => g.Id == id && !g.IsDeleted);
            var response      = new InstroductionResponse
            {
                Name        = instroduction.Name,
                Description = instroduction.Description
            };

            return(response);
        }
示例#2
0
        public ActionResult Update(int id)
        {
            var instroduction = _instroductionService.GetInstroduction(id);

            if (instroduction == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            var updateInstroduction = new InstroductionResponse
            {
                Id          = id,
                Description = instroduction.Description,
                CreateBy    = instroduction.CreateBy,
                CreateDate  = instroduction.CreateDate,
                Name        = instroduction.Name
            };

            return(View("Update", updateInstroduction));
        }