Ejemplo n.º 1
0
        public LogicResponseHandler <string> AddEntity(bool deleted, Firm firm, AspNetUser aspNetUser,
                                                       string bio, string contactEmail, string firmId, ICollection <Internship> internships,
                                                       string lastName, string name, string recruiterId, string userId)
        {
            var result = _repo.AddEntity(
                new Recruiter
            {
                AspNetUser   = aspNetUser,
                Bio          = bio,
                ContactEmail = contactEmail,
                Deleted      = deleted,
                Firm         = firm,
                FirmId       = firmId,
                Internships  = internships,
                LastName     = lastName,
                Name         = name,
                RecruiterId  = recruiterId,
                UserId       = userId
            });

            if (result.Succes)
            {
                return(new LogicResponseHandler <string> {
                    Status = true, Content = "Succes!"
                });
            }
            else
            {
                return(new LogicResponseHandler <string> {
                    Status = false, Content = result.Container
                });
            }
        }
Ejemplo n.º 2
0
        public LogicResponseHandler <string> AddEntity(bool deleted, string description,
                                                       Image image, ICollection <Recruiter> recruiters, ICollection <Internship> internships,
                                                       string firmId, string logo, string name, int numberOfEmployees)
        {
            var result = _repo.AddEntity(
                new Firm
            {
                Deleted           = deleted,
                Description       = description,
                FirmId            = firmId,
                Image             = image,
                Internships       = internships,
                Logo              = logo,
                Name              = name,
                NumberOfEmployees = numberOfEmployees,
                Recruiters        = recruiters
            });

            if (result.Succes)
            {
                return(new LogicResponseHandler <string> {
                    Status = true, Content = "Succes!"
                });
            }
            else
            {
                return(new LogicResponseHandler <string> {
                    Status = false, Content = result.Container
                });
            }
        }
Ejemplo n.º 3
0
        public LogicResponseHandler <string> AddEntity(string category, string city,
                                                       ICollection <Comment> comments, DateTime deadlineAplications, bool deleted,
                                                       string department, string description, string duration, DateTime endDate,
                                                       ICollection <File> files, Firm firm, string firmOrganizerid, bool hidden,
                                                       Image image, string internshipId, string internshipPostPhoto,
                                                       string keywords, DateTime lastUpdated, int positionsAvailable, Recruiter recruiter,
                                                       string recruiterResponsibleId, DateTime startDate, ICollection <StudentInternship> studentInternships,
                                                       ICollection <StudentInternship> studentInternships1, string title, string typeJob)
        {
            var result = _repo.AddEntity(
                new Internship
            {
                Category               = category,
                City                   = city,
                Comments               = comments,
                DeadlineApplications   = deadlineAplications,
                Deleted                = deleted,
                Department             = department,
                Description            = description,
                Duration               = duration,
                EndDate                = endDate,
                Files                  = files,
                Firm                   = firm,
                FirmOrganizerId        = firmOrganizerid,
                Hidden                 = hidden,
                Image                  = image,
                InternshipId           = internshipId,
                InternshipPostPhoto    = internshipPostPhoto,
                Keywords               = keywords,
                LastUpdated            = lastUpdated,
                PositionsAvailable     = positionsAvailable,
                Recruiter              = recruiter,
                RecruiterResponsibleId = recruiterResponsibleId,
                StartDate              = startDate,
                StudentInternships     = studentInternships,
                Title                  = title,
                TypeJob                = typeJob
            });

            if (result.Succes)
            {
                return(new LogicResponseHandler <string> {
                    Status = true, Content = "Succes!"
                });
            }
            else
            {
                return(new LogicResponseHandler <string> {
                    Status = false, Content = result.Container
                });
            }
        }
        public void Add_SimpleItem_OK()
        {
            string guid = Guid.NewGuid().ToString();


            Firm newEntity = new Firm
            {
                FirmId            = guid,
                Description       = "AN ADD",
                Name              = "New FIRM",
                NumberOfEmployees = 10,
                Deleted           = false,
            };
            DataResponseHandler <string> result = instance.AddEntity(newEntity);
            bool expected = true;

            Assert.AreEqual(expected, result.Succes);
        }
Ejemplo n.º 5
0
        public LogicResponseHandler <string> AddEntity(bool?available, DateTime birthday,
                                                       string domain, string faculty, string levelOfStudies, Resume resume, string skills,
                                                       string websiteLink, string university, bool?subscribed,
                                                       ICollection <StudentInternship> studentInternships, string studentId, string studentCV,
                                                       AspNetUser aspNetUser, string bio, bool?deleted, string lastName, string name, string userId)
        {
            var result = _repo.AddEntity(
                new Student
            {
                AspNetUser         = aspNetUser,
                Bio                = bio,
                Deleted            = deleted,
                LastName           = lastName,
                Name               = name,
                UserId             = userId,
                Available          = available,
                Birthday           = birthday,
                Domain             = domain,
                Faculty            = faculty,
                LevelOfStudies     = levelOfStudies,
                Resume             = resume,
                Skills             = skills,
                StudentCV          = studentCV,
                StudentId          = studentId,
                StudentInternships = studentInternships,
                Subscribed         = subscribed,
                University         = university,
                WebsiteLink        = websiteLink
            });

            if (result.Succes)
            {
                return(new LogicResponseHandler <string> {
                    Status = true, Content = "Succes!"
                });
            }
            else
            {
                return(new LogicResponseHandler <string> {
                    Status = false, Content = result.Container
                });
            }
        }