/* * public static tpu_ComprobantesExDataset.tpu_ComprobanteDetalleDeudaRow NewRow(tpu_ComprobantesExDataset data) * { * return data.tpu_ComprobanteDetalleDeuda.Newtpu_ComprobanteDetalleDeudaRow(); * } */ public static tpu_ComprobanteDetalleDeudaDataset.tpu_ComprobanteDetalleDeudaRow GetByPk(string IdComprobante, short Cuota) { tpu_ComprobanteDetalleDeudaDataset data = new tpu_ComprobanteDetalleDeudaDataset(); SqlCommand cmd = new SqlCommand("Pr_tpu_ComprobanteDetalleDeuda_GetByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); cmd.Parameters["@IdComprobante"].Value = IdComprobante; cmd.Parameters.Add(new SqlParameter("@Cuota", SqlDbType.SmallInt)); cmd.Parameters["@Cuota"].Value = Cuota; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tpu_ComprobanteDetalleDeuda"); adapter.Fill(data); if (data.tpu_ComprobanteDetalleDeuda.Rows.Count == 1) { return((tpu_ComprobanteDetalleDeudaDataset.tpu_ComprobanteDetalleDeudaRow)data.tpu_ComprobanteDetalleDeuda.Rows[0]); } return(null); }
/// <summary> /// Envia los cambios del tpu_ComprobanteDetalleDeudaDataset a la base de datos. /// </summary> public static void Update(tpu_ComprobanteDetalleDeudaDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tpu_ComprobanteDetalleDeuda.Rows.Count > 0, "La tabla dataSet.tpu_ComprobanteDetalleDeudaDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tpu_ComprobanteDetalleDeuda.Update(dataSet); }
public static tpu_ComprobanteDetalleDeudaDataset GetList() { tpu_ComprobanteDetalleDeudaDataset data = new tpu_ComprobanteDetalleDeudaDataset(); return(( tpu_ComprobanteDetalleDeudaDataset )GetList(data)); }
public static void Update(tpu_ComprobanteDetalleDeudaDataset dataSet) { Update(dataSet.tpu_ComprobanteDetalleDeuda); }
public void Commit() { _dataComprobante = new tpu_ComprobantesDataset(); _dataComprobanteDeCompra = new tpu_ComprobantesDeCompraDataset(); _dataComprobanteDetalleDeuda = new tpu_ComprobanteDetalleDeudaDataset(); _dataComprobantesDet = new tpu_ComprobantesDetDataset(); _dataComprobantesDetalleDePagos = new tpu_ComprobanteDetalleDePagosDataset(); foreach (string _idComprobanteAAnular in _idComprobantesAAnular) { if (_idComprobanteAAnular != null && _idComprobanteAAnular != string.Empty) { tpu_ComprobantesDataset.tpu_ComprobantesRow rowAux = businessrules.tpu_Comprobantes.GetByPk(_idComprobanteAAnular); if (rowAux != null) { string IdTipoDeComprobante = rowAux.IdTipoDeComprobante; if (_tableComprobantesAnulacion.ContainsKey(IdTipoDeComprobante)) { string IdTipoDeComprobanteAnula = Convert.ToString(_tableComprobantesAnulacion[IdTipoDeComprobante]); /*tpu_Comprobantes*/ tpu_ComprobantesDataset.tpu_ComprobantesRow rowC = mz.erp.businessrules.tpu_Comprobantes.GetByPk(_idComprobanteAAnular); rowC.IdTipoDeComprobante = IdTipoDeComprobanteAnula; _dataComprobante.tpu_Comprobantes.ImportRow((DataRow)rowC); /*tpu_ComprobantesDeCompra*/ tpu_ComprobantesDeCompraDataset.tpu_ComprobantesDeCompraRow rowCC = mz.erp.businessrules.tpu_ComprobantesDeCompra.GetByPk(_idComprobanteAAnular); if (rowCC != null) { rowCC["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; _dataComprobanteDeCompra.tpu_ComprobantesDeCompra.ImportRow(rowCC); } /*tpu_ComprobantesDet*/ // tpu_ComprobantesDetDataset dataCD = mz.erp.businessrules.tpu_ComprobantesDet.GetByPk(_idComprobanteAAnular); // foreach (DataRow row in dataCD.tpu_ComprobantesDet.Rows) // { // if (row != null) // { // row["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; // _dataComprobantesDet.tpu_ComprobantesDet.ImportRow(row); // } // } /*tpu_ComprobanteDetalleDePagos*/ tpu_ComprobanteDetalleDePagosDataset dataCDP = mz.erp.businessrules.tpu_ComprobanteDetalleDePagos.GetList(null, null, _idComprobanteAAnular, null, decimal.MinValue); foreach (DataRow row in dataCDP.tpu_ComprobanteDetalleDePagos.Rows) { if (row != null) { row["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; _dataComprobantesDetalleDePagos.tpu_ComprobanteDetalleDePagos.ImportRow(row); } } /*tpu_ComprobanteDetalleDeuda*/ //tpu_ComprobanteDetalleDeudaDataset dataCDD = mz.erp.businessrules.tpu_ComprobanteDetalleDeuda.GetList(_idComprobanteAAnular, null, null); DataSet dataCDD = mz.erp.businessrules.tpu_ComprobanteDetalleDeuda.GetList(_idComprobanteAAnular, null, null); foreach (DataRow row in dataCDD.Tables[0].Rows) //foreach(DataRow row in dataCDD.tpu_ComprobanteDetalleDeuda.Rows) { if (row != null) { row["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; _dataComprobanteDetalleDeuda.tpu_ComprobanteDetalleDeuda.ImportRow(row); } } } } } } }