public async Task UpdateADMasterIndustryType(ADMasterIndustryType objADMasterIndustryType) { try { _Context.Entry(objADMasterIndustryType).State = EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertADMasterIndustryType(ADMasterIndustryType objADMasterIndustryType) { try { _Context.ADMasterIndustryTypes.Add(objADMasterIndustryType); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterIndustryTypeResult> > PutADMasterIndustryType(long id, ADMasterIndustryType objADMasterIndustryType) { if (id != objADMasterIndustryType.MasterIndustryTypeId) { return(BadRequest()); } try { await _IMasterIndustryTypeInterface.UpdateADMasterIndustryType(objADMasterIndustryType); return(_IMasterIndustryTypeInterface.GetADMasterIndustryTypeByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterIndustryTypeInterface.ADMasterIndustryTypeExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterIndustryTypeResult> > PostADMasterIndustryType(ADMasterIndustryType objADMasterIndustryType) { try { await _IMasterIndustryTypeInterface.InsertADMasterIndustryType(objADMasterIndustryType); return(CreatedAtAction("GetADMasterIndustryType", new { id = objADMasterIndustryType.MasterIndustryGroupId }, objADMasterIndustryType)); } catch (Exception ex) { throw new Exception(ex.Message); } }