Esempio n. 1
0
        public LogicResponseHandler <string> UpdateEntity(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.UpdateEntity(
                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
                });
            }
        }
Esempio n. 2
0
        public LogicResponseHandler <string> UpdateEntity(string oldGuid, 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.UpdateEntity(
                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
                });
            }
        }
Esempio n. 3
0
        public LogicResponseHandler <string> UpdateEntity(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.UpdateEntity(
                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
                });
            }
        }
        public void Update_OK()
        {
            /// changed values for tests


            Func <Entities> contextCreator = () => new Entities();


            Firm updateEntity = new Firm
            {
                FirmId            = "e20badcf-fd71-4ca1-9f2d-a8d1335f7c34",
                Description       = "GENERIC AN UPDATED FIRM",
                Name              = "New FIRM",
                NumberOfEmployees = 10,
                Deleted           = false,
            };

            var  result   = instance.UpdateEntity(updateEntity);
            bool expected = true;

            Assert.AreEqual(expected, result.Succes);
        }
Esempio n. 5
0
        public LogicResponseHandler <string> UpdateEntity(string oldGuid, 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, string firmId,
                                                          ICollection <Internship> internships, string logo, string name)
        {
            var result = _repo.UpdateEntity(
                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
                });
            }
        }