コード例 #1
0
        // GET: Project/Edit/5
        public ActionResult Edit(int id)
        {
            SProject SProject = new SProject();

            Persistence.Entities.Project Project = SProject.Get(id);
            return(View(Project));
        }
コード例 #2
0
        public List <OfferUser> GetSetProjetToUser(int Id)
        {
            //Guid userInfoId = new Guid(IdUser.ToString());
            SUser    suser     = new SUser();
            SProject sproject  = new SProject();
            SOffer   soffer    = new SOffer();
            var      offeruser = soffer.GetOfferUserById(Id);

            var user   = suser.GetUserById(new Guid(offeruser.IdUser));
            var offere = soffer.GetOffer(offeruser.IdOffer);

            Persistence.Entities.Project     project     = new Persistence.Entities.Project();
            Persistence.Entities.ProjectUser projectuser = new Persistence.Entities.ProjectUser();
            projectuser.IdUser = offeruser.IdUser;

            project.IdCategory = offere.Category.Id;
            project.IdOffer    = offere.Id;

            //project.Inicio = soffer.GetPhaseInitial(idoffer).InitPhase;
            //project.Fin= soffer.GetPhaseFinal(idoffer).FinishPhase;
            //project.Phases = new List<OfferPhase>();
            //project.Phases = soffer.GetOfferPhases(idoffer).Select(e=>new OfferPhase().InjectFrom(e)).Cast<OfferPhase>().ToList();
            project.Postulantes = soffer.GetOfferUser(offeruser.IdOffer).OfferUsers.Count();
            project.Status      = Persistence.Entities.StatusProject.EnCurso;

            sproject.Insert(project, projectuser);

            return(GetOfferUsers(offeruser.IdOffer));
        }
コード例 #3
0
 public ActionResult Edit(int id, FormCollection collection, Models.Project Project)
 {
     try
     {
         SProject SProject = new SProject();
         Persistence.Entities.Project project = new Persistence.Entities.Project();
         project.InjectFrom(Project);
         Persistence.Entities.Project updaoofer = SProject.Update(project);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #4
0
        public ActionResult Create(FormCollection collection, Models.Project Project)
        {
            try
            {
                // TODO: Add insert logic here
                SProject SProject = new SProject();

                Persistence.Entities.Project projectp = new Persistence.Entities.Project();
                projectp.InjectFrom(Project);
                SProject.Insert(projectp);
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }