Example #1
0
        public IList <FeedBackView> QueryList(int appId, string menuCode = null)
        {
            Expression <Func <FeedBackEntity, bool> > where;
            if (menuCode == null)
            {
                where = x => x.AppID == appId;
            }
            else
            {
                where = x => x.AppID == appId && x.MenuCode == menuCode;
            }

            var list = Repository.Entities.Where(where).ToList();

            var codes = list.Select(y => y.MenuCode).ToList();

            //var categories = _categoryService.Repository.Entities.Where(x => codes.Contains(x.CategoryCode)).Select(x => new { code = x.CategoryCode, name = x.CategoryName }).ToList();

            var viewList = list.Select(x =>
            {
                //var category = categories.Find(y => y.code == x.MenuCode);
                var view = new FeedBackView();
                view.ConvertAPIModel(x);
                //view.MenuName = category.name;
                return(view);
            }).ToList();


            return(viewList);
        }
Example #2
0
        public async Task <IActionResult> FeedBack(FeedBackView model)
        {
            FeedBackDTO feedBackDTO = new FeedBackDTO();

            {
                feedBackDTO.FirstName   = model.FirstName;
                feedBackDTO.LastName    = model.LastName;
                feedBackDTO.Email       = model.Email;
                feedBackDTO.Description = model.Description;
            };

            await _feedBackService.FeebBack(feedBackDTO);

            return(View("Index"));
        }
Example #3
0
 public int Create(FeedBackView item)
 {
     try
     {
         Entity.Feedback fb = new Entity.Feedback()
         {
             id = item.id, email = item.email, content = item.content, created = item.created, status = item.status
         };
         db.Feedbacks.Add(fb);
         db.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         return(0);
     }
 }
Example #4
0
 public static FeedBack EntityMap(this FeedBackView model)
 {
     return(Mapper.Map <FeedBackView, FeedBack>(model));
 }
Example #5
0
 public int Update(FeedBackView item)
 {
     throw new NotImplementedException();
 }