public List <clsEntityRetention_RetentionLine> cs_fxObtenerTodoPorCabeceraId(string Id) { List <clsEntityRetention_RetentionLine> List_PerceptionLine; try { List_PerceptionLine = new List <clsEntityRetention_RetentionLine>(); OdbcDataReader datos = null; string sql = "SELECT * FROM " + cs_cmTabla + " WHERE cs_Retention_Id=" + Id.Trim() + " ;"; //clsBaseConexion cn = new clsBaseConexion(); OdbcConnection cs_pxConexion_basedatos = new OdbcConnection(localDB.cs_prConexioncadenabasedatos()); cs_pxConexion_basedatos.Open(); datos = new OdbcCommand(sql, cs_pxConexion_basedatos).ExecuteReader(); clsEntityRetention_RetentionLine PerceptionLine; while (datos.Read()) { PerceptionLine = new clsEntityRetention_RetentionLine(localDB); PerceptionLine.Cs_pr_Retention_RetentionLine_Id = datos[0].ToString(); PerceptionLine.Cs_pr_Retention_Id = datos[1].ToString(); PerceptionLine.Cs_tag_Id = datos[2].ToString(); PerceptionLine.Cs_tag_Id_SchemeId = datos[3].ToString(); PerceptionLine.Cs_tag_IssueDate = datos[4].ToString(); PerceptionLine.Cs_tag_TotalInvoiceAmount = datos[5].ToString(); PerceptionLine.Cs_tag_TotalInvoiceAmount_CurrencyId = datos[6].ToString(); PerceptionLine.Cs_tag_Payment_PaidDate = datos[7].ToString(); PerceptionLine.Cs_tag_Payment_Id = datos[8].ToString(); PerceptionLine.Cs_tag_Payment_PaidAmount = datos[9].ToString(); PerceptionLine.Cs_tag_Payment_PaidAmount_CurrencyId = datos[10].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_SUNATRetentionAmount = datos[11].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_SUNATRetentionAmount_CurrencyId = datos[12].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_SUNATRetentionDate = datos[13].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_SUNATNetTotalPaid = datos[14].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_SUNATNetTotalPaid_CurrencyId = datos[15].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_ExchangeRate_SourceCurrencyCode = datos[16].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_ExchangeRate_TargetCurrencyCode = datos[17].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_ExchangeRate_CalculationRate = datos[18].ToString(); PerceptionLine.Cs_tag_SUNATRetentionInformation_ExchangeRate_Date = datos[19].ToString(); List_PerceptionLine.Add(PerceptionLine); } cs_pxConexion_basedatos.Close(); return(List_PerceptionLine); } catch (Exception ex) { clsBaseMensaje.cs_pxMsgEr("ERR6", ex.ToString()); clsBaseLog.cs_pxRegistarAdd("clsEntityRetention_RetentionLine cs_fxObtenerTodoPorCabeceraId" + ex.ToString()); return(null); } }
public bool cs_pxEliminarDocumento(string Id) { bool resultado = false; try { //Eliminar la cabecera y todos sus registros. clsEntityRetention Document = new clsEntityRetention(localDB).cs_fxObtenerUnoPorId(Id); clsEntityRetention_RetentionLine Document_Line = new clsEntityRetention_RetentionLine(localDB); foreach (var item in Document_Line.cs_fxObtenerTodoPorCabeceraId(Id)) { item.cs_pxElimnar(false); } Document.cs_pxElimnar(false); resultado = true; } catch (Exception ex) { clsBaseLog.cs_pxRegistarAdd(" clsEntityRetention cs_pxEliminarDocumento " + ex.ToString()); } return(resultado); }