public PorachkaViewModel GetPorackaFinish(int id) { Porachka porachka = this.Context.Porachki.Find(id); PorachkaViewModel model = Mapper.Map <Porachka, PorachkaViewModel>(porachka); return(model); }
public ICollection <PorachkaViewModel> GetActivePorachkiViewMoedel() { var porachki = this.Context.Porachki.Where(p => p.IsActive); IList <PorachkaViewModel> models = new List <PorachkaViewModel>(); foreach (var porachka in porachki) { PorachkaViewModel model = Mapper.Map <Porachka, PorachkaViewModel>(porachka); models.Add(model); } return(models); }
public ICollection <PorachkaViewModel> GetPorachkiViewMoedel() { var porachki = this.Context.Porachki.OrderByDescending(p => p.Id); IList <PorachkaViewModel> models = new List <PorachkaViewModel>(); foreach (var porachka in porachki) { PorachkaViewModel model = Mapper.Map <Porachka, PorachkaViewModel>(porachka); models.Add(model); } return(models); }
public ActionResult FinishPorachka(int id) { PorachkaViewModel porachka = this.service.GetPorackaFinish(id); return(this.View(porachka)); }