예제 #1
0
 public Boolean GuardarDB(ro_Comprobantes_Contables_Info info)
 {
     try
     {
         List <ro_area_Info> Lst = new List <ro_area_Info>();
         using (EntitiesRoles Context = new EntitiesRoles())
         {
             var Address = new ro_Comprobantes_Contables();
             Address.IdEmpresa      = info.IdEmpresa;
             Address.IdCbteCble     = info.IdCbteCble;
             Address.IdPeriodo      = info.IdPeriodo;
             Address.CodCtbteCble   = info.CodCtbteCble;
             Address.cb_Observacion = info.cb_Observacion;
             Address.IdTipoCbte     = info.IdTipoCbte;
             Context.ro_Comprobantes_Contables.Add(Address);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }
예제 #2
0
        public bool grabarDB(ro_Comprobantes_Contables_Info info)
        {
            try
            {
                using (Entities_rrhh Contex = new Entities_rrhh())
                {
                    ro_Comprobantes_Contables Entity = new ro_Comprobantes_Contables
                    {
                        IdEmpresa    = info.IdEmpresa,
                        IdNomina     = info.IdNomina,
                        IdNominaTipo = info.IdNominaTipo,
                        IdPeriodo    = info.IdPeriodo,
                        IdTipoCbte   = info.IdTipoCbte,
                        IdCbteCble   = info.IdCbteCble,
                        CodCtbteCble = info.CodCtbteCble
                    };
                    Contex.ro_Comprobantes_Contables.Add(Entity);
                    Contex.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }