Ejemplo n.º 1
0
 public static CandidateSubmissionModel ConvertToCandidateSubmissionModel(this tblCandidateSubmission data)
 {
     return(new CandidateSubmissionModel()
     {
         ID = Convert.ToInt32(data.ID),
         VacancyId = Convert.ToInt32(data.VacancyID),
         CandidateId = Convert.ToInt32(data.CandidateID),
         StatusId = data.StatusID.ToString(),
         BillRate = data.BillRate,
         isActive = data.IsActive,
         isDeleted = data.IsDeleted,
         createdUserID = data.CreatedUserID,
         updatedUserID = data.UpdatedUserID,
         createdTimestamp = data.CreatedTimestamp,
         updatedTimestamp = data.UpdatedTimestamp,
         CandidateStatus = data.tblCandidateStatu?.ConvertToCandidateStatusModel()
     });
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }