예제 #1
0
        public async Task InsertADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType)
        {
            try
            {
                _Context.ADMasterRegistrationType.Add(objADMasterRegistrationType);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
        public async Task UpdateADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType)
        {
            try
            {
                _Context.Entry(objADMasterRegistrationType).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #3
0
        public async Task DeleteADMasterRegistrationType(long MasterRegistrationTypeId)
        {
            try
            {
                ADMasterRegistrationType objADMasterRegistrationType = _Context.ADMasterRegistrationType.Find(MasterRegistrationTypeId);
                _Context.ADMasterRegistrationType.Remove(objADMasterRegistrationType);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #4
0
        public async Task <ActionResult <MasterRegistrationTypeResult> > PutADMasterRegistrationType(long id, ADMasterRegistrationType objADMasterRegistrationType)
        {
            if (id != objADMasterRegistrationType.MasterRegistrationTypeId)
            {
                return(BadRequest());
            }


            try
            {
                await _IMasterRegistrationTypeInterface.UpdateADMasterRegistrationType(objADMasterRegistrationType);

                return(_IMasterRegistrationTypeInterface.GetADMasterRegistrationTypeByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMasterRegistrationTypeInterface.ADMasterRegistrationTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }
예제 #5
0
        public async Task <ActionResult <MasterRegistrationTypeResult> > PostADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType)
        {
            try
            {
                await _IMasterRegistrationTypeInterface.InsertADMasterRegistrationType(objADMasterRegistrationType);

                return(CreatedAtAction("GetADMasterRegistrationType", new { id = objADMasterRegistrationType.MasterRegistrationTypeId }, objADMasterRegistrationType));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }