Beispiel #1
0
        public async Task InsertADMasterBankAccountType(ADMasterBankAccountType objADMasterBankAccountType)
        {
            try
            {
                _Context.ADMasterBankAccountTypes.Add(objADMasterBankAccountType);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Beispiel #2
0
        public async Task UpdateADMasterBankAccountType(ADMasterBankAccountType objADMasterBankAccountType)
        {
            try
            {
                _Context.Entry(objADMasterBankAccountType).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Beispiel #3
0
        public async Task DeleteADMasterBankAccountType(long MasterBankAccountTypeId)
        {
            try
            {
                ADMasterBankAccountType objADMasterBankAccountType = _Context.ADMasterBankAccountTypes.Find(MasterBankAccountTypeId);
                _Context.ADMasterBankAccountTypes.Remove(objADMasterBankAccountType);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Beispiel #4
0
        public async Task <ActionResult <MasterBankAccountTypeResult> > PutADMasterBankAccountType(long id, ADMasterBankAccountType objADMasterBankAccountType)
        {
            if (id != objADMasterBankAccountType.MasterBankAccountTypeId)
            {
                return(BadRequest());
            }


            try
            {
                await _IMasterBankAccountTypeInterface.UpdateADMasterBankAccountType(objADMasterBankAccountType);

                return(_IMasterBankAccountTypeInterface.GetADMasterBankAccountTypeByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMasterBankAccountTypeInterface.ADMasterBankAccountTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }
Beispiel #5
0
        public async Task <ActionResult <MasterBankAccountTypeResult> > PostADMasterBankAccountType(ADMasterBankAccountType objADMasterBankAccountType)
        {
            try
            {
                await _IMasterBankAccountTypeInterface.InsertADMasterBankAccountType(objADMasterBankAccountType);

                return(CreatedAtAction("GetADMasterBankAccountType", new { id = objADMasterBankAccountType.MasterBankAccountTypeId }, objADMasterBankAccountType));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }