public static tsa_ComprobantesDetDataset GetList(string IdComprobante, DateTime Fecha, string Numero, string IdProducto, long Ordinal) { tsa_ComprobantesDetDataset data = new tsa_ComprobantesDetDataset(); data = (tsa_ComprobantesDetDataset)GetList((System.Data.DataSet)data, IdComprobante, Fecha, Numero, IdProducto, Ordinal); return(data); }
public static tsa_ComprobantesDetDataset.tsa_ComprobantesDetRow GetByPk(string IdComprobante, long Ordinal) { tsa_ComprobantesDetDataset data = new tsa_ComprobantesDetDataset(); SqlCommand cmd = new SqlCommand("Pr_tsa_ComprobantesDet_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("@Ordinal", SqlDbType.BigInt)); cmd.Parameters["@Ordinal"].Value = Ordinal; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsa_ComprobantesDet"); adapter.Fill(data); if (data.tsa_ComprobantesDet.Rows.Count == 1) { return((tsa_ComprobantesDetDataset.tsa_ComprobantesDetRow)data.tsa_ComprobantesDet.Rows[0]); } return(null); }
/// <summary> /// Envia los cambios del tsa_ComprobantesDetDataset a la base de datos. /// </summary> public static void Update(tsa_ComprobantesDetDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsa_ComprobantesDet.Rows.Count > 0, "La tabla dataSet.tsa_ComprobantesDetDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tsa_ComprobantesDet.Update(dataSet); }
public void Commit() { _dataComprobante = new tsa_ComprobantesExDataset(); foreach (string _idComprobanteAAnular in _idComprobantesAAnular) { if (_idComprobanteAAnular != null && _idComprobanteAAnular != string.Empty) { tsa_ComprobantesDataset.tsa_ComprobantesRow rowAux = businessrules.tsa_Comprobantes.GetByPk(_idComprobanteAAnular); if (rowAux != null) { string IdTipoDeComprobante = rowAux.IdTipoDeComprobante; if (_tableComprobantesAnulacion.ContainsKey(IdTipoDeComprobante)) { string IdTipoDeComprobanteAnula = Convert.ToString(_tableComprobantesAnulacion[IdTipoDeComprobante]); tsa_ComprobantesDataset.tsa_ComprobantesRow rowC = mz.erp.businessrules.tsa_Comprobantes.GetByPk(_idComprobanteAAnular); rowC.IdTipoDeComprobante = IdTipoDeComprobanteAnula; _dataComprobante.tsa_Comprobantes.ImportRow((DataRow)rowC); tsa_ComprobantesDetDataset dataCD = mz.erp.businessrules.tsa_ComprobantesDet.GetByPk(_idComprobanteAAnular); foreach (DataRow row in dataCD.tsa_ComprobantesDet.Rows) { if (row != null) { row["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; _dataComprobante.tsa_ComprobantesDet.ImportRow(row); } } tsa_ComprobanteDetalleImpuestosDataset dataCDI = mz.erp.businessrules.tsa_ComprobanteDetalleImpuestos.GetList(_idComprobanteAAnular); foreach (DataRow row in dataCDI.tsa_ComprobanteDetalleImpuestos.Rows) { if (row != null) { row["IdTipoDeComprobante"] = IdTipoDeComprobanteAnula; _dataComprobante.tsa_ComprobanteDetalleImpuestos.ImportRow(row); } } } } } } }
private void FillEditData() { //tsa_ComprobantesDetDataset data = (tsa_ComprobantesDetDataset)mz.erp.businessrules.tsa_ComprobantesDet.GetList( this._comprobanteDeVenta.IdComprobante,DateTime.MinValue,null,null, long.MinValue); tsa_ComprobantesDetDataset data = (tsa_ComprobantesDetDataset)mz.erp.businessrules.tsa_ComprobantesDet.GetByPk(this._comprobanteDeVenta.IdComprobante); System.Data.DataTable table = data.Tables[0]; foreach (System.Data.DataRow row in table.Rows) { Productos miProducto = new mz.erp.businessrules.Productos((string)row["IdProducto"]); Item item = new Item(miProducto); item.IdProducto = miProducto.IdProducto; item.Cantidad = (decimal)row["Cantidad"]; item.PrecioNeto = (decimal)row["PrecioNeto"]; item.PrecioBruto = (decimal)row["PrecioBruto"]; item.Descripcion = miProducto.Descripcion; item.DescripcionCorta = miProducto.DescripcionCorta; item.DescripcionLarga = miProducto.DescripcionLarga; item.BonificacionRecargoProducto = (decimal)row["BonificacionRecargoProducto"]; item.PrecioCostoMonedaReferencia = (decimal)row["PrecioDeCosto"]; item.BonificacionAplicada = (decimal)row["DescuentosAplicados"]; item.BonificacionRecargoFinanciero = (decimal)row["BonificacionRecargoFinanciero"]; item.OrdinalDestino = (long)row["Ordinal"]; /*Nuevo medidas German*/ item.SetConversion(this._comprobanteDeVenta.Momento); item.IdListaDePrecios = (string)row["IdListaDePrecio"]; item.CoeficienteListaDePrecios = (decimal)row["CoeficienteListaDePrecio"]; item.ModoDeAplicacionListaDePrecios = (string)row["ModoDeAplicacion"]; ItemComprobante miItemComprobante = new ItemComprobante("EDIT", this, item); //if (miItemComprobante.Visible) this.Add(miItemComprobante); //Hasta Aca //this.Add(new ItemComprobante("EDIT",this, row)); } }
public static tsa_ComprobantesDetDataset GetListByPk(string IdComprobante) { tsa_ComprobantesDetDataset data = new tsa_ComprobantesDetDataset(); SqlCommand cmd = new SqlCommand("Pr_tsa_ComprobantesDet_GetListByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); cmd.Parameters["@IdComprobante"].Value = IdComprobante; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsa_ComprobantesDet"); adapter.Fill(data); return(data); }
public static tsa_ComprobantesDetDataset GetList() { tsa_ComprobantesDetDataset data = new tsa_ComprobantesDetDataset(); return(( tsa_ComprobantesDetDataset )GetList(data)); }
public static void Update(tsa_ComprobantesDetDataset dataSet) { Update(dataSet.tsa_ComprobantesDet); }