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; }
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; }
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); }
/*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()); } }
public IActionResult GetAll() { var list = _planRepository.GetAll(); return(Ok(list)); }