Пример #1
0
        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));
        }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }
Пример #4
0
        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());
            }
        }
Пример #5
0
        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));
        }