コード例 #1
0
ファイル: ManageCandidate.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
ファイル: ManageCandidate.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #7
0
ファイル: ManageRole.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #8
0
        //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;
            }
        }
コード例 #9
0
        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;
            }
        }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
        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;
            }
        }
コード例 #12
0
ファイル: ManageCandidate.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
ファイル: ManageSupplier.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #15
0
        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;
            }
        }
コード例 #16
0
        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;
            }
        }
コード例 #17
0
        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;
            }
        }
コード例 #18
0
 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;
     }
 }
コード例 #19
0
ファイル: ManageCandidate.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #20
0
        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;
            }
        }
コード例 #21
0
ファイル: ManageCandidate.cs プロジェクト: chandusekhar/eMSP
        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;
            }
        }
コード例 #22
0
        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;
            }
        }
コード例 #23
0
        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;
            }
        }
コード例 #24
0
        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;
            }
        }
コード例 #25
0
 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;
     }
 }
コード例 #26
0
        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;
            }
        }
コード例 #27
0
        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;
            }
        }
コード例 #28
0
        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;
            }
        }
コード例 #29
0
        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;
            }
        }
コード例 #30
0
        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;
            }
        }