예제 #1
0
 public IActionResult Update(int IdCuentaContable, [FromBody] PlanDeCuenta entity)
 {
     try
     {
         planDeCuentaBusiness.Update(IdCuentaContable, entity);
         return(Ok(true));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
 public IActionResult Create([FromBody] PlanDeCuenta entity)
 {
     try
     {
         planDeCuentaBusiness.Create(entity);
         return(Ok(true));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #3
0
 public PlanDeCuenta GetCuenta(int IdEmpresa, string CodCuenta)
 {
     try
     {
         SiinErpContext context = new SiinErpContext();
         PlanDeCuenta   entity  = context.PlanDeCuentas.FirstOrDefault(x => x.IdEmpresa == IdEmpresa && x.CodCuenta.Equals(CodCuenta));
         return(entity);
     }
     catch (Exception ex)
     {
         errorBusiness.Create("GetPlanContab", ex.Message, null);
         throw;
     }
 }
예제 #4
0
 public void Create(PlanDeCuenta entity)
 {
     try
     {
         entity.FechaCreacion = DateTimeOffset.Now;
         SiinErpContext context = new SiinErpContext();
         context.PlanDeCuentas.Add(entity);
         context.SaveChanges();
     }
     catch (Exception ex)
     {
         errorBusiness.Create("CreatePlanContab", ex.Message, null);
         throw;
     }
 }
예제 #5
0
 public void Update(int IdCuentaContable, PlanDeCuenta entity)
 {
     try
     {
         SiinErpContext context = new SiinErpContext();
         PlanDeCuenta   ob      = context.PlanDeCuentas.Find(IdCuentaContable);
         ob.CodCuenta    = entity.CodCuenta;
         ob.NivelCuenta  = entity.NivelCuenta;
         ob.NombreCuenta = entity.NombreCuenta;
         ob.TerceroSN    = entity.TerceroSN;
         ob.Estado       = entity.Estado;
         context.SaveChanges();
     }
     catch (Exception ex)
     {
         errorBusiness.Create("UpdatePlanContab", ex.Message, null);
         throw;
     }
 }