-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mikayel-terhov/M
M
- Loading branch information
Showing
59 changed files
with
1,974 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 93 additions & 10 deletions
103
InternshipsManagementProject.Logic/Sercice/FirmService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,107 @@ | ||
using System; | ||
using InternshipsManagementProject.Logic.Models; | ||
using InternshipsManagmentProject.Data; | ||
using InternshipsManagmentProject.Data.Repos; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using InternshipsManagmentProject.Data.Interfaces; | ||
|
||
namespace InternshipsManagementProject.Logic.Sercice | ||
{ | ||
public class FirmService | ||
{ | ||
private IRepository repo; | ||
private RepositoryGenericDRH<Firm> _repo = new RepositoryGenericDRH<Firm>(); | ||
|
||
public FirmService(string connectionString) | ||
|
||
public void InternsipService() | ||
{ | ||
this._repo = new RepositoryGenericDRH<Firm>(); | ||
} | ||
|
||
public LogicResponseHandler<Firm> GetById(string id) | ||
{ | ||
var result = _repo.GetById(id); | ||
if (result.Succes) | ||
{ | ||
return new LogicResponseHandler<Firm> { Content = result.Container, Status = result.Succes }; | ||
} | ||
else | ||
{ | ||
return new LogicResponseHandler<Firm> { Status = false }; | ||
} | ||
} | ||
|
||
public LogicResponseHandler<IEnumerable<Firm>> GetAll() | ||
{ | ||
var result = _repo.GetAll(); | ||
if (result.Succes) | ||
{ | ||
return new LogicResponseHandler<IEnumerable<Firm>> { Content = result.Container, Status = result.Succes }; | ||
} | ||
else | ||
{ | ||
return new LogicResponseHandler<IEnumerable<Firm>> { Status = false }; | ||
} | ||
} | ||
|
||
public LogicResponseHandler<string> AddEntity(bool deleted, string description, | ||
Image image, ICollection<Recruiter> recruiters, ICollection<Internship> internships, | ||
string firmId, string logo, string name, int numberOfEmployees) | ||
{ | ||
//this.repo = new RepositoryInternshipsManagment(); | ||
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 }; | ||
} | ||
} | ||
|
||
public string GetFirmById(string guid) | ||
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) | ||
{ | ||
return string.Empty; | ||
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 }; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 98 additions & 5 deletions
103
InternshipsManagementProject.Logic/Sercice/RecruterService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,105 @@ | ||
using System; | ||
using InternshipsManagementProject.Logic.Models; | ||
using InternshipsManagmentProject.Data; | ||
using InternshipsManagmentProject.Data.Repos; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace InternshipsManagementProject.Logic.Sercice | ||
{ | ||
class RecruterService | ||
public class RecruterService | ||
{ | ||
private RepositoryGenericDRH<Recruiter> _repo = new RepositoryGenericDRH<Recruiter>(); | ||
|
||
|
||
public void InternsipService() | ||
{ | ||
this._repo = new RepositoryGenericDRH<Recruiter>(); | ||
} | ||
|
||
public LogicResponseHandler<Recruiter> GetById(string id) | ||
{ | ||
var result = _repo.GetById(id); | ||
if (result.Succes) | ||
{ | ||
return new LogicResponseHandler<Recruiter> { Content = result.Container, Status = result.Succes }; | ||
} | ||
else | ||
{ | ||
return new LogicResponseHandler<Recruiter> { Status = false }; | ||
} | ||
} | ||
|
||
public LogicResponseHandler<IEnumerable<Recruiter>> GetAll() | ||
{ | ||
var result = _repo.GetAll(); | ||
if (result.Succes) | ||
{ | ||
return new LogicResponseHandler<IEnumerable<Recruiter>> { Content = result.Container, Status = result.Succes }; | ||
} | ||
else | ||
{ | ||
return new LogicResponseHandler<IEnumerable<Recruiter>> { Status = false }; | ||
} | ||
} | ||
|
||
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 }; | ||
} | ||
} | ||
|
||
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 }; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.