public ActionResult Edit(int id) { ZonaFl.Business.SubSystems.SPortfolio portF = new Business.SubSystems.SPortfolio(); var portf = portF.GetPortFolioById(id); Models.PortFolio portfm = new Models.PortFolio(); portfm.InjectFrom(portf); return(View(portfm)); }
public ActionResult CreateById(string id) { Business.SubSystems.SCategory scategory = new Business.SubSystems.SCategory(); Models.PortFolio porfM = new Models.PortFolio(); porfM.AspNetUser = new Models.RegisterBindingModel(); porfM.AspNetUser.Id = id; porfM.UserId = id; porfM.Categories = scategory.FindAll().Select(e => new Category().InjectFrom(e)).Cast <Category>().ToList(); ViewBag.IdUser = id; return(View("Create", porfM)); }
public ActionResult GetPortfolioByUser(string id) { ZonaFl.Persistence.Entities.PortFolio portf = null; ZonaFl.Business.SubSystems.SPortfolio portF = new Business.SubSystems.SPortfolio(); portf = portF.GetPortFolioByUserId(id.Replace("#nuevowork", ""), SessionBag.Current.User.Id); if (portf == null) { portf = new Persistence.Entities.PortFolio(); } Models.PortFolio porfM = new Models.PortFolio(); porfM.InjectFrom(portf); return(Json(porfM, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(int id, FormCollection collection, Models.PortFolio portfolio) { try { ZonaFl.Business.SubSystems.SPortfolio portF = new Business.SubSystems.SPortfolio(); Entities.PortFolio portfolioU = new Entities.PortFolio(); portfolioU.InjectFrom(portfolio); portF.Update(portfolioU); // TODO: Add update logic here return(RedirectToAction("Details", id)); } catch { return(View()); } }
public ActionResult GetPortfolioByUserAnId(string id, string userid) { ZonaFl.Persistence.Entities.PortFolio portf = null; Business.SubSystems.SCategory scategory = new Business.SubSystems.SCategory(); ZonaFl.Business.SubSystems.SPortfolio portF = new Business.SubSystems.SPortfolio(); portf = portF.GetPortFolioByUserId(id, userid); if (portf == null) { portf = new Persistence.Entities.PortFolio(); } Models.PortFolio porfM = new Models.PortFolio(); porfM.InjectFrom(portf); var catp = scategory.FindCategoryById(portf.CategoriaId); if (catp != null) { porfM.Categoria = catp.Name; } return(Json(porfM, JsonRequestBehavior.AllowGet)); }