Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
0
        public string GetSuspendUser(string id)
        {
            SUser suser = new SUser();
            var   user  = suser.GetUserById(Guid.Parse(id));

            user.Status = State.Suspendido.ToString();


            bool rta = suser.DeleteUser(Guid.Parse(id));

            //suser.UpdateUser(user);
            if (rta)
            {
                return(id);
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 3
0
        public List <OfferUser> GetOfferUsers(int offerid)
        {
            SOffer soffer = new SOffer();
            SUser  suser  = new SUser();
            Offer  offerm = new Offer();

            var offere = soffer.GetOfferUser(offerid);

            if (offere != null)
            {
                offerm.InjectFrom(offere);
            }
            offerm.OfferUsers = new List <OfferUser>();

            if (offere != null)
            {
                offerm.OfferUsers = offere.OfferUsers.Select(e => new OfferUser().InjectFrom(e)).Cast <OfferUser>().ToList();
                offerm.OfferUsers.ForEach(e => e.NameUser = suser.GetUserById(new Guid(e.IdUser)).UserName);
                offerm.OfferUsers.ForEach(e => e.Url      = "/Freelance/ReadForEmployer/" + e.IdUser);
            }
            return(offerm.OfferUsers);
        }