public async Task InsertADMasterFinancialYear(ADMasterFinancialYear objADMasterFinancialYear)
        {
            try
            {
                _Context.ADMasterFinancialYears.Add(objADMasterFinancialYear);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public async Task UpdateADMasterFinancialYear(ADMasterFinancialYear objADMasterFinancialYear)
        {
            try
            {
                _Context.Entry(objADMasterFinancialYear).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public async Task DeleteADMasterFinancialYear(long MasterFinancialYearId)
        {
            try
            {
                ADMasterFinancialYear objADMasterFinancialYear = _Context.ADMasterFinancialYears.Find(MasterFinancialYearId);
                _Context.ADMasterFinancialYears.Remove(objADMasterFinancialYear);

                await _Context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Beispiel #4
0
        public async Task <ActionResult <MasterFinancialYearResult> > PutADMasterFinancialYear(long id, ADMasterFinancialYear objADMasterFinancialYear)
        {
            if (id != objADMasterFinancialYear.MasterFinancialYearId)
            {
                return(BadRequest());
            }


            try
            {
                await _IMasterFinancialYearInterface.UpdateADMasterFinancialYear(objADMasterFinancialYear);

                return(_IMasterFinancialYearInterface.GetADMasterFinancialYearByID(id));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_IMasterFinancialYearInterface.ADMasterFinancialYearExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(NoContent());
        }
Beispiel #5
0
        public async Task <ActionResult <MasterFinancialYearResult> > PostADMasterFinancialYear(ADMasterFinancialYear objADMasterFinancialYear)
        {
            try
            {
                await _IMasterFinancialYearInterface.InsertADMasterFinancialYear(objADMasterFinancialYear);

                return(CreatedAtAction("GetADMasterFinancialYear", new { id = objADMasterFinancialYear.MasterFinancialYearId }, objADMasterFinancialYear));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }