public bool GrabarDB(List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info> Lista) { try { int secuencia = 0; using (EntitiesBanco context = new EntitiesBanco()) { foreach (var item in Lista) { secuencia = secuencia + 1; ba_Archivo_Transferencia_x_PreAviso_Cheq_det Addres = new ba_Archivo_Transferencia_x_PreAviso_Cheq_det(); Addres.IdEmpresa = item.IdEmpresa; context.ba_Archivo_Transferencia_x_PreAviso_Cheq_det.Add(Addres); 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean Actualizar_registro(ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info Info) { try { using (EntitiesBanco Conexion = new EntitiesBanco()) { ba_Archivo_Transferencia_x_PreAviso_Cheq_det Entity = Conexion.ba_Archivo_Transferencia_x_PreAviso_Cheq_det.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdArchivo_preaviso_cheq == Info.IdArchivo_preaviso_cheq && q.secuencia == Info.secuencia); //Entity.Id_Item = Info.Id_Item; //Entity.IdEstadoRegistro_cat = Info.IdEstadoRegistro_cat; //**Entity.Valor_cobrado = Info.Valor_cobrado; Conexion.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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }