internal static async Task <tblCandidate> InsertCandidate(tblCandidate model) { try { using (db = new eMSPEntities()) { var candidate = db.tblCandidates.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(candidate); } } catch (Exception) { throw; } }
internal static async Task DeleteVacancySkills(long VacancyId) { try { using (db = new eMSPEntities()) { List <tblVacancieSkill> vacancySkills = db.tblVacancieSkills.Where(q => q.VacancyID == VacancyId) .ToList(); db.tblVacancieSkills.RemoveRange(vacancySkills); int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblCandidateSubmissionSpend> InsertCandidateSubmissionSpend(tblCandidateSubmissionSpend model) { try { using (db = new eMSPEntities()) { var response = db.tblCandidateSubmissionSpends.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception ex) { throw; } }
internal static async Task DeleteCustomer(long Id) { try { using (db = new eMSPEntities()) { tblCustomer obj = await db.tblCustomers.FindAsync(Id); db.tblCustomers.Remove(obj); int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblCandidateTimesheetCategoriesHour> InsertCandidateTimesheetCategoriesHours(tblCandidateTimesheetCategoriesHour model) { try { using (db = new eMSPEntities()) { var candidateTimesheetCategoriesHours = db.tblCandidateTimesheetCategoriesHours.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(candidateTimesheetCategoriesHours); } } catch (Exception) { throw; } }
internal static async Task <tblContact> InsertContacts(tblContact model) { try { using (db = new eMSPEntities()) { var contact = db.tblContacts.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(contact); } } catch (Exception) { throw; } }
internal static async Task <AspNetRoleGroupRole> InsertRoleGroupRoles(AspNetRoleGroupRole model) { try { using (db = new eMSPEntities()) { var roleGroup = db.AspNetRoleGroupRoles.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(roleGroup); } } catch (Exception) { throw; } }
//internal static async Task<tblVacanciesRequiredDocument> UpdateVacanciesRequiredDocument(tblVacanciesRequiredDocument data, tblVacancy vacancy) //{ // try // { // using (db = new eMSPEntities()) // { // tblVacanciesRequiredDocument model = await Task.Run(() => db.tblVacanciesRequiredDocuments // .Where(b => b.VacancyID == vacancy.ID && b.ID == data.ID) // .FirstOrDefaultAsync()); // if (model != null) // { // db.Entry(model).State = EntityState.Modified; // int x = await Task.Run(() => db.SaveChangesAsync()); // } // else { // model = await Task.Run(() => AddVacanciesRequiredDocument(data, vacancy)); // } // return model; // } // } // catch (Exception) // { // throw; // } //} #endregion #region Delete internal static async Task DeleteVacanciesRequiredDocument(long VacancyId) { try { using (db = new eMSPEntities()) { List <tblVacanciesRequiredDocument> requiredDocsList = db.tblVacanciesRequiredDocuments .Where(rd => rd.VacancyID == VacancyId) .ToList(); db.tblVacanciesRequiredDocuments.RemoveRange(requiredDocsList); int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblCustomerLocationBranch> InsertCustomerLocationBranch(tblCustomerLocationBranch model) { try { using (db = new eMSPEntities()) { model = db.tblCustomerLocationBranches.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task <tblSupplierUser> ToggleUser(tblSupplierUser model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task <tblVacancyFile> UpdateVacancyFile(tblVacancyFile model, tblVacancy vacancy) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task UpdateCandidateFiles(tblCandidateFile model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); //return model; } } catch (Exception) { throw; } }
internal static async Task <tblVacancyComment> CommentVacancy(tblVacancyComment model) { try { using (db = new eMSPEntities()) { model = db.tblVacancyComments.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception ex) { throw; } }
internal static async Task <tblSupplier> InsertSupplier(tblSupplier model) { try { using (db = new eMSPEntities()) { model = db.tblSuppliers.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task <tblCandidatePlacement> UpdateCandidatePlacement(tblCandidatePlacement model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task <tblCandidatePlacement> InsertCandidatePlacement(tblCandidatePlacement data) { try { using (db = new eMSPEntities()) { db.tblCandidatePlacements.Add(data); int x = await Task.Run(() => db.SaveChangesAsync()); return(data); } } catch (Exception ex) { throw; } }
internal static async Task DeleteCandidatePlacement(long Id) { try { using (db = new eMSPEntities()) { tblCandidatePlacement obj = await db.tblCandidatePlacements.FindAsync(Id); db.tblCandidatePlacements.Remove(obj); await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task DeleteCandidateSubmissionSpend(long PlacementID) { try { using (db = new eMSPEntities()) { List <tblCandidateSubmissionSpend> obj = db.tblCandidateSubmissionSpends .Where(cs => cs.PlacementID == PlacementID) .ToList(); db.tblCandidateSubmissionSpends.RemoveRange(obj); int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <CandidateSubmissionModel> InsertCandidateSubmissions(tblCandidateSubmission model) { try { using (db = new eMSPEntities()) { model = db.tblCandidateSubmissions.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(GetCandidateSubmission(model.VacancyID).Result.SingleOrDefault(a => a.ID == model.ID).ConvertToCandidateSubmissionModel()); } } catch (Exception ex) { throw; } }
internal static async Task DeleteTimesheetStatus(long Id) { try { using (db = new eMSPEntities()) { tblTimesheetStatu obj = await db.tblTimesheetStatus.FindAsync(Id); db.tblTimesheetStatus.Remove(obj); await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <CandidateSubmissionModel> UpdateCandidateSubmissions(tblCandidateSubmission model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model.ConvertToCandidateSubmissionModel()); } } catch (Exception ex) { throw; } }
internal static async Task <tblTimesheetStatu> InsertTimesheetStatus(tblTimesheetStatu data) { try { using (db = new eMSPEntities()) { db.tblTimesheetStatus.Add(data); int x = await Task.Run(() => db.SaveChangesAsync()); return(data); } } catch (Exception ex) { throw; } }
internal static async Task <tblCountry> InsertCountry(tblCountry model) { try { using (db = new eMSPEntities()) { model = db.tblCountries.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception ex) { throw; } }
internal static async Task <tblCustomerLocationBranch> UpdateCustomerLocationBranch(tblCustomerLocationBranch model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task DeleteCandidateSubmissionsQuestionsRespons(long SubmissionId) { try { using (db = new eMSPEntities()) { List <tblCandidateSubmissionsQuestionsRespons> obj = db.tblCandidateSubmissionsQuestionsResponses .Where(cs => cs.SubmissionID == SubmissionId) .ToList(); db.tblCandidateSubmissionsQuestionsResponses.RemoveRange(obj); int x = await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblIndustrySkill> InsertIndustrySkill(tblIndustrySkill model) { try { using (db = new eMSPEntities()) { model = db.tblIndustrySkills.Add(model); int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task <tblMSPSpendCategory> UpdateMSPSpendCategory(tblMSPSpendCategory model) { try { using (db = new eMSPEntities()) { db.Entry(model).State = EntityState.Modified; int x = await Task.Run(() => db.SaveChangesAsync()); return(model); } } catch (Exception) { throw; } }
internal static async Task DeleteMSPMSPSpendCategory(long Id) { try { using (db = new eMSPEntities()) { tblMSPSpendCategory obj = await db.tblMSPSpendCategories.FindAsync(Id); db.tblMSPSpendCategories.Remove(obj); await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }
internal static async Task <tblMSPSpendCategory> InsertMSPSpendCategory(tblMSPSpendCategory data) { try { using (db = new eMSPEntities()) { db.tblMSPSpendCategories.Add(data); int x = await Task.Run(() => db.SaveChangesAsync()); return(data); } } catch (Exception ex) { throw; } }
internal static async Task UpdateVacancySupplier(long VacancyId) { try { using (db = new eMSPEntities()) { List <tblVacancySupplier> model = await Task.Run(() => db.tblVacancySuppliers.Where(q => q.VacancyID == VacancyId) .ToList()); model.All(vs => { vs.IsDeleted = true; return(true); }); await Task.Run(() => db.SaveChangesAsync()); } } catch (Exception) { throw; } }