Пример #1
0
        public async Task <ActionResult <MasterLoginTypeResult> > PutADMasterLoginType(long id, ADMasterLoginType objADMasterLoginType)
        {
            if (id != objADMasterLoginType.MasterLoginTypeId)
            {
                return(BadRequest());
            }


            try
            {
                await _IMasterLoginTypeInterface.UpdateADMasterLoginType(objADMasterLoginType);

                return(_IMasterLoginTypeInterface.GetADMasterLoginTypeByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMasterLoginTypeInterface.ADMasterLoginTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult <MasterLoginTypeResult> > PostADMasterLoginType(ADMasterLoginType objADMasterLoginType)
        {
            try
            {
                await _IMasterLoginTypeInterface.InsertADMasterLoginType(objADMasterLoginType);

                return(CreatedAtAction("GetADMasterLoginType", new { id = objADMasterLoginType.MasterLoginTypeId }, objADMasterLoginType));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }