Ejemplo n.º 1
0
 public List<PlanModel> GetPlans()
 {
     //unitOfWork.StartTransaction();
     List<PlanModel> planModel = new List<PlanModel>();
     List<Plan> plan = new List<Plan>();
     PlanRepository planRepository = new PlanRepository(unitOfWork);
     plan = planRepository.GetAll().OrderByDescending(x=>x.PlanId).ToList();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(plan,planModel);
     return planModel;
 }
Ejemplo n.º 2
0
 public PlanModel GetPlanById(int planId)
 {
     //unitOfWork.StartTransaction();
     PlanRepository planRepository = new PlanRepository(unitOfWork);
     PlanModel planModel = new PlanModel();
     Plan plan = new Plan();
     plan = planRepository.GetAll().Where(x => x.PlanId == planId).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(plan, planModel);
     return planModel;
 }
Ejemplo n.º 3
0
        public List <PlanModel> GetAllPlans()
        {
            List <PlanModel> planListModel = new List <PlanModel>();
            List <Plan>      listPlan      = planRepository.GetAll(x => x.RecordDeleted == false).OrderBy(y => y.ModifiedDate).ToList();


            AutoMapper.Mapper.Map(listPlan, planListModel);



            return(planListModel);
        }
Ejemplo n.º 4
0
        /*protected HttpServerUtility User
         * {
         *  get; set;
         * }*/


        public ActionResult Index()
        {
            if (_currentUser == null)
            {
                return(RedirectToAction("Login", "Account", null));
            }
            else
            {
                List <Plan> PlanList = _plans.GetAll(Guid.Parse(_currentUser)).ToList();
                ViewBag.Plans = PlanList;
                return(View());
            }
        }
Ejemplo n.º 5
0
        public IActionResult GetAll()
        {
            var list = _planRepository.GetAll();

            return(Ok(list));
        }