示例#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);
            }
        }