public int Compare(object x, object y) { TipoDeComprobante tdc1 = (TipoDeComprobante)x; TipoDeComprobante tdc2 = (TipoDeComprobante)y; return(tdc1.CompareTo(tdc2)); }
public static TiposDeComprobantes GetTiposDeComprobantes() { TiposDeComprobantes result = new TiposDeComprobantes(); DataTable table = mz.erp.businessrules.tsy_TiposDeComprobantes.GetList().Tables[0]; foreach (DataRow row in table.Rows) { string IdTipoDeComprobante = Convert.ToString(row["IdTipoDeComprobante"]); string Descripcion = Convert.ToString(row["Descripcion"]); string Familia = Convert.ToString(row["Familia"]); string Mascara = Convert.ToString(row["Mascara"]); bool Activo = Convert.ToBoolean(row["Activo"]); bool RequiereCondicionDeVenta = Convert.ToBoolean(row["RequiereCondicionDeVenta"]); int Signo = Convert.ToInt16(row["Signo"]); int SignoCuentaCorriente = Convert.ToInt16(row["SignoCtaCte"]); int TipoCuentaCorriente = Convert.ToInt16(row["TipoCtaCte"]); TipoDeComprobante tc = new TipoDeComprobante(); tc.IdTipoComprobante = IdTipoDeComprobante; tc.Descripcion = Descripcion; tc.Familia = Familia; tc.Mascara = Mascara; tc.Activo = Activo; tc.RequiereCondicionDeVenta = RequiereCondicionDeVenta; tc.Signo = Signo; tc.SignoCuentaCorriente = SignoCuentaCorriente; tc.TipoCuentaCorriente = TipoCuentaCorriente; result.Add(tc); } result.Sort(); return(result); }
public int CompareTo(object obj) { TipoDeComprobante tdc = (TipoDeComprobante)obj; int result = tdc.Descripcion.CompareTo(this.Descripcion); return(result); }
public static TiposDeComprobantes GetTiposDeComprobanteRequiereCondicionDeVenta() { TiposDeComprobantes result = new TiposDeComprobantes(); DataTable table = mz.erp.businessrules.tsy_TiposDeComprobantes.GetList().Tables[0]; foreach (DataRow row in table.Rows) { bool ReqCondVenta = Convert.ToBoolean(row["RequiereCondicionDeVenta"]); if (ReqCondVenta) { string IdTipoDeComprobante = Convert.ToString(row["IdTipoDeComprobante"]); string Descripcion = Convert.ToString(row["Descripcion"]); string Familia = Convert.ToString(row["Familia"]); TipoDeComprobante tc = new TipoDeComprobante(); tc.IdTipoComprobante = IdTipoDeComprobante; tc.Descripcion = Descripcion; tc.Familia = Familia; tc.RequiereCondicionDeVenta = true; result.Add(tc); } } result.Sort(); return(result); }
public void GetCondicionDeVenta_IdCondicionDeVenta(string IdCondicionDeVenta) { _estado = "MODIFY"; tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow row = mz.erp.dataaccess.tsa_CondicionesDeVentas.GetByPk(IdCondicionDeVenta); this.FillStaticData(row); tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow rowCondVtaDet = mz.erp.dataaccess.tsa_CondicionesDeVentaDet.GetByPk(IdCondicionDeVenta, 1); this.FillStaticDataDet(rowCondVtaDet); tfi_TDCompTesoreria_CondicionesDeVentaDataset data = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null, null, IdCondicionDeVenta); //_dataTDCompTesoreria_CondVenta = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null,null,IdCondicionDeVenta); this._listaFormasDePagoSeleccionadas.RemoveRange(0, this._listaFormasDePagoSeleccionadas.Count); if (data.tfi_TDCompTesoreria_CondicionesDeVenta.Rows.Count != 0) { tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDComp = (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow)data.tfi_TDCompTesoreria_CondicionesDeVenta.Rows[0]; this.MetodoComparacion = rowTDComp.MetodoDeComparacion; foreach (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowfp in data.tfi_TDCompTesoreria_CondicionesDeVenta.Rows) { if ((rowfp["idTDCompTesoreria"].ToString() != string.Empty) && (rowfp["idTDCompTesoreria"].ToString() != "NULL")) { FormaDePago fp = _formasDePago.GetByTDCompTesoreria(rowfp.idTDCompTesoreria); this._listaFormasDePagoSeleccionadas.Add(fp); } } } Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset dataTiposComp = mz.erp.dataaccess.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.GetList(null, null, null, IdCondicionDeVenta); /* Silvina 20100601 - Tarea 767 */ if (dataTiposComp.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Count != 0) { Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow rowTiposComp = (Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow)dataTiposComp.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows[0]; this.MetodoDeAsignacionTipoDeComprobante = rowTiposComp.MetodoDeAsignacion; } /* Fin Silvina */ this._listaTiposDeComprobantesSeleccionados.RemoveRange(0, this._listaTiposDeComprobantesSeleccionados.Count); if (dataTiposComp.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows.Count != 0) { foreach (Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow rowTDC in dataTiposComp.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows) { TipoDeComprobante tdc = _tiposDeComprobantes.GetByTDComp(rowTDC.IdTipoDeComprobante); if (tdc != null) { this._listaTiposDeComprobantesSeleccionados.Add(tdc); } } } this._listaCuentas = mz.erp.businessrules.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.GetCuentas(IdCondicionDeVenta); /* Silvina 20100601 - Tarea 767 */ if (_listaCuentas.Count != 0) { this.MetodoDeAsignacionCuenta = ((Cuenta)_listaCuentas[0]).MetodoDeAsignacion; } /* Fin Silvina */ if (_proceso.Equals("ProcesoModificarCondicionDeVentaGeneral")) { foreach (Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow rowComp in dataTiposComp.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows) { if (rowComp.MetodoDeAsignacion.Equals("E")) { MessageBox.Show("Hay comprobantes por exclusión", "Advertencia", System.Windows.Forms.MessageBoxButtons.OK); break; } } Cuentas cuentas = _listaCuentas.GetByMetodoAsignacion("E"); if (cuentas.Count != 0) { MessageBox.Show("Hay cuentas Excluidas", "Advertencia", System.Windows.Forms.MessageBoxButtons.OK); } } }