public ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Get_Info_Archivo_Transferencia(int idEmpresa, decimal idArchivo) { try { ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Archivo = new ba_Archivo_Transferencia_x_PreAviso_Cheq_Info(); using (EntitiesBanco Conexion = new EntitiesBanco()) { ba_Archivo_Transferencia_x_PreAviso_Cheq item = Conexion.ba_Archivo_Transferencia_x_PreAviso_Cheq.FirstOrDefault(q => q.IdArchivo_preaviso_cheq == idArchivo && q.IdEmpresa == idEmpresa); if (item != null) { Archivo.IdEmpresa = item.IdEmpresa; Archivo.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq; Archivo.IdBanco = item.IdBanco; Archivo.Nom_Archivo = item.Nom_Archivo; Archivo.Fecha = item.Fecha; Archivo.Archivo = item.Archivo; Archivo.Estado = item.Estado; Archivo.IdUsuario = item.IdUsuario; Archivo.Fecha_Transac = item.Fecha_Transac; Archivo.Observacion = item.Observacion; Archivo.IdUsuarioUltMod = item.IdUsuarioUltMod; Archivo.Fecha_UltMod = item.Fecha_UltMod; Archivo.IdUsuarioUltAnu = item.IdUsuarioUltAnu; Archivo.Fecha_UltAnu = item.Fecha_UltAnu; Archivo.Nom_pc = item.Nom_pc; Archivo.Ip = item.Ip; Archivo.Motivo_anulacion = item.Motivo_anulacion; } //ba_Archivo_Transferencia_Det_Data oData_det = new ba_Archivo_Transferencia_Det_Data(); //Archivo.Lst_Archivo_Transferencia_Det = oData_det.Get_List_Archivo_transferencia_Det(Archivo.IdEmpresa, Archivo.IdProceso_bancario, Archivo.IdArchivo); } return(Archivo); } 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.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }
public bool GrabarDB(ba_Archivo_Transferencia_x_PreAviso_Cheq_Info info, ref decimal IdArchivo) { try { List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info>(); using (EntitiesBanco context = new EntitiesBanco()) { ba_Archivo_Transferencia_x_PreAviso_Cheq address = new ba_Archivo_Transferencia_x_PreAviso_Cheq(); info.Fecha = Convert.ToDateTime(info.Fecha.ToShortDateString()); address.IdEmpresa = info.IdEmpresa; address.IdArchivo_preaviso_cheq = GetId(info.IdEmpresa); address.cod_Archivo_preaviso_cheq = GetId_codigoArchivo(info.IdEmpresa, info.Fecha); address.IdBanco = info.IdBanco; address.Nom_Archivo = info.Nom_Archivo; address.Fecha = info.Fecha; if (info.Archivo == null) { info.Archivo = new byte[000000]; } address.Archivo = info.Archivo; address.Estado = info.Estado; address.IdUsuario = info.IdUsuario; address.Fecha_Transac = (DateTime)info.Fecha_Transac; address.Observacion = info.Observacion; context.ba_Archivo_Transferencia_x_PreAviso_Cheq.Add(address); context.SaveChanges(); IdArchivo = address.IdArchivo_preaviso_cheq; 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.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }