public async Task <IHttpActionResult> GetMSPVacancyType(MSPVacancieTypeCreateModel data) { try { return(Ok((await VacanciesService.GetMSPVacancieType(data)).AsQueryable())); } catch (Exception) { throw; } }
//public async Task<VacancySkillsCreateModel> UpdateVacancySkill(VacancySkillsCreateModel model) //{ // try // { // tblVacancieSkill data = await Task.Run(() => ManageVacancySkills.UpdateVacancySkills(model.ConvertTotblVacancySkill())); // return data.ConvertToVacancySkill(); // } // catch (Exception) // { // throw; // } //} //public async Task<VacancyLocationsCreateModel> UpdateVacancyLocation(VacancyLocationsCreateModel model) //{ // try // { // tblVacancyLocation data = await Task.Run(() => ManageVacancyLocations.UpdateVacancyLocation(model.ConvertTotblVacancyLocation())); // return data.ConvertToVacancyLocation(); // } // catch (Exception) // { // throw; // } //} //public async Task<VacancySuppliersCreateModel> UpdateVacancySupplier(VacancySuppliersCreateModel model) //{ // try // { // tblVacancySupplier data = await Task.Run(() => ManageVacancySuppliers.UpdateVacancySupplier(model.ConvertTotblVacancySupplier())); // return data.ConvertToVacancySupplier(); // } // catch (Exception) // { // throw; // } //} public async Task <MSPVacancieTypeCreateModel> UpdateMSPVacancieType(MSPVacancieTypeCreateModel model) { try { tblMSPVacancieType data = await Task.Run(() => ManageMSPVacancieType.UpdateMSPVacancieType(model.ConvertTotblMSPVacancieType())); return(data.ConvertToMSPVacancieType()); } catch (Exception) { throw; } }
public async Task <IHttpActionResult> DeleteMSPVacancieType(MSPVacancieTypeCreateModel data) { try { await VacanciesService.DeleteMSPVacancieType(data.id); return(Ok("Success")); } catch (Exception) { throw; } }
public async Task <IHttpActionResult> UpdateMSPVacancieType(MSPVacancieTypeCreateModel model) { try { userId = User.Identity.GetUserId(); Helpers.Helpers.AddBaseProperties(model, "update", userId); return(Ok(await VacanciesService.UpdateMSPVacancieType(model))); } catch (Exception) { throw; } }
public async Task <MSPVacancieTypeCreateModel> CreateMSPVacancieType(MSPVacancieTypeCreateModel data) { try { long mspId = Convert.ToInt64(ConfigurationManager.AppSettings["MSP_ID"]); data.mspId = data.mspId != 0 ? data.mspId : mspId; tblMSPVacancieType dataMSPVacancieType = await Task.Run(() => ManageMSPVacancieType.InsertMSPVacancieType(data.ConvertTotblMSPVacancieType())); return(dataMSPVacancieType.ConvertToMSPVacancieType()); } catch (Exception) { throw; } }
public static tblMSPVacancieType ConvertTotblMSPVacancieType(this MSPVacancieTypeCreateModel data) { return(new tblMSPVacancieType() { ID = Convert.ToInt16(data.id), MSPID = data.mspId, Name = data.name, IsActive = data.isActive, IsDeleted = data.isDeleted ?? false, CreatedUserID = data.createdUserID, UpdatedUserID = data.updatedUserID, CreatedTimestamp = data.createdTimestamp ?? DateTime.Now, UpdatedTimestamp = data.updatedTimestamp ?? DateTime.Now }); }
//public async Task<List<VacancySkillsCreateModel>> GetVacancySkills(long Id) //{ // try // { // List<VacancySkillsCreateModel> data = null; // List<tblVacancieSkill> res = await Task.Run(() => ManageVacancySkills.GetVacancySkills(Id)); // data = res.Select(x => x.ConvertToVacancySkill()).ToList(); // return data; // } // catch (Exception) // { // throw; // } //} //public async Task<List<VacancyLocationsCreateModel>> GetVacancyLocations(long Id) //{ // try // { // List<VacancyLocationsCreateModel> data = null; // List<tblVacancyLocation> res = await Task.Run(() => ManageVacancyLocations.GetVacancyLocations(Id)); // data = res.Select(x => x.ConvertToVacancyLocation()).ToList(); // return data; // } // catch (Exception) // { // throw; // } //} //public async Task<List<VacancySuppliersCreateModel>> GetVacancySupplier(long Id) //{ // try // { // List<VacancySuppliersCreateModel> data = null; // List<tblVacancySupplier> res = await Task.Run(() => ManageVacancySuppliers.GetVacancySuppliers(Id)); // data = res.Select(x => x.ConvertToVacancySupplier()).ToList(); // return data; // } // catch (Exception ex) // { // throw; // } //} public async Task <List <MSPVacancieTypeCreateModel> > GetMSPVacancieType(MSPVacancieTypeCreateModel data) { try { long Id = data.mspId != 0 ? Convert.ToInt64(data.mspId) : 0; long id = Convert.ToInt64(ConfigurationManager.AppSettings["MSP_ID"]); Id = Id != 0 ? Id : id; List <MSPVacancieTypeCreateModel> model = null; List <tblMSPVacancieType> dataVT = null; dataVT = await Task.Run(() => ManageMSPVacancieType.GetMSPVacancieTypes(Id)); model = dataVT.Select(a => a.ConvertToMSPVacancieType()).ToList(); return(model); } catch (Exception ex) { throw; } }