Exemple #1
0
        //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;
            }
        }
Exemple #2
0
        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 MSPVacancieTypeCreateModel ConvertToMSPVacancieType(this tblMSPVacancieType data)
 {
     return(new MSPVacancieTypeCreateModel()
     {
         id = data.ID,
         name = data.Name,
         mspId = data.MSPID,
         isActive = data.IsActive,
         isDeleted = data.IsDeleted,
         createdUserID = data.CreatedUserID,
         updatedUserID = data.UpdatedUserID,
         createdTimestamp = data.CreatedTimestamp,
         updatedTimestamp = data.UpdatedTimestamp
     });
 }
        internal static async Task DeleteMSPVacancieType(long Id)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    tblMSPVacancieType obj = await db.tblMSPVacancieTypes.FindAsync(Id);

                    db.tblMSPVacancieTypes.Remove(obj);
                    int x = await Task.Run(() => db.SaveChangesAsync());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        internal static async Task <tblMSPVacancieType> UpdateMSPVacancieType(tblMSPVacancieType 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 <tblMSPVacancieType> InsertMSPVacancieType(tblMSPVacancieType model)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    model = db.tblMSPVacancieTypes.Add(model);

                    int x = await Task.Run(() => db.SaveChangesAsync());

                    return(model);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }