Example #1
0
        public async Task <ResponseModel> Insert(EmployeeWorkingStatusModel model)
        {
            ResponseModel response = new ResponseModel();

            try
            {
                EmployeeWorkingStatus md = new EmployeeWorkingStatus();

                md.Code        = model.Code;
                md.Name        = model.Name;
                md.Description = model.Description;
                md.Precedence  = model.Precedence;
                md.IsActive    = model.IsActive;
                md.CreateBy    = base.UserId;
                md.CreateDate  = DateTime.Now;
                md.Deleted     = false;

                await _context.EmployeeWorkingStatusRepository.AddAsync(md).ConfigureAwait(true);

                await _context.SaveChangesAsync();

                _memoryCachingService.Remove(CacheKey);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
        public async Task <ResponseModel> Insert(ProfessionalQualificationModel model)
        {
            ResponseModel response = new ResponseModel();

            try
            {
                ProfessionalQualification md = new ProfessionalQualification();

                md.Name       = model.Name;
                md.Precedence = model.Precedence;
                md.IsActive   = model.IsActive;
                md.CreateBy   = base.UserId;
                md.CreateDate = DateTime.Now;
                md.Deleted    = false;

                await _context.ProfessionalQualificationRepository.AddAsync(md).ConfigureAwait(true);

                await _context.SaveChangesAsync();

                _memoryCachingService.Remove(CacheKey);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }