public Boolean EliminarDB(int IdEmpresa, int IdSucursal, decimal IdOrdenCompra, int secuencia, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_orden_giro_x_com_ordencompra_local_det.FirstOrDefault(cp => cp.IdEmpresa_OC == IdEmpresa && cp.IdSucursal_OC == IdSucursal && cp.IdOrdenCompra == IdOrdenCompra && cp.Secuencia_OC == secuencia);
             if (contact != null)
             {
                 context.cp_orden_giro_x_com_ordencompra_local_det.Remove(contact);
                 context.SaveChanges();
                 context.Dispose();
             }
         }
         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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
Beispiel #2
0
 public Boolean EliminarDB(cp_proveedor_codigo_SRI_Info Info)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_proveedor_codigo_SRI.FirstOrDefault(min => min.IdEmpresa == Info.IdEmpresa && min.IdProveedor == Info.IdProveedor && min.IdCodigo_SRI == Info.IdCodigo_SRI);
             if (contact != null)
             {
                 context.cp_proveedor_codigo_SRI.Remove(contact);
                 context.SaveChanges();
                 context.Dispose();
             }
         }
         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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }