public async Task InsertADMasterBankAccountType(ADMasterBankAccountType objADMasterBankAccountType) { try { _Context.ADMasterBankAccountTypes.Add(objADMasterBankAccountType); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
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); } }
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); } }
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()); }
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); } }