Example #1
0
 private void FillStaticDataDet(tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow row)
 {
     if (row != null)
     {
         this.Cuotas            = row.Cuota;
         this.DiasDeVencimiento = row.DiasVencimiento;
     }
 }
Example #2
0
        public static void Update(tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetDataTable)row.Table).Addtsa_CondicionesDeVentaDetRow(row);
            }

            Update(row.Table);
        }
Example #3
0
        public void Commit()
        {
            if (_estado == "NEW")
            {
                #region NEW

                tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow rowCondVta = _dataCondVenta.tsa_CondicionesDeVentas.Newtsa_CondicionesDeVentasRow();

                mz.erp.businessrules.tsa_CondicionesDeVentas.SetRowDefaultValues(rowCondVta);

                rowCondVta.Descripcion = this._descripcion;
                rowCondVta.Recargo     = this._recargo;
                rowCondVta.Activo      = this._activo;

                _dataCondVenta.tsa_CondicionesDeVentas.Rows.Add(rowCondVta);

                tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow rowCondVtaDet = _dataCondVentaDet.tsa_CondicionesDeVentaDet.Newtsa_CondicionesDeVentaDetRow();

                mz.erp.businessrules.tsa_CondicionesDeVentaDet.SetRowDefaultValues(rowCondVtaDet);
                rowCondVtaDet.DiasVencimiento = this._diasDeVencimiento;

                _dataCondVentaDet.tsa_CondicionesDeVentaDet.Rows.Add(rowCondVtaDet);

                AgregarFormaDePago();
                AgregarComprobante();
                AgregarCuenta();

                #endregion
            }
            else
            {              //estado = "MODIFY"
                #region MODIFY

                tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow rowCondVta = mz.erp.dataaccess.tsa_CondicionesDeVentas.GetByPk(_idCondicionDeVenta);

                rowCondVta.Descripcion = this._descripcion;
                rowCondVta.Recargo     = this._recargo;
                rowCondVta.Activo      = this._activo;

                _dataCondVenta.tsa_CondicionesDeVentas.ImportRow(rowCondVta);

                tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow rowCondVtaDet = mz.erp.dataaccess.tsa_CondicionesDeVentaDet.GetByPk(_idCondicionDeVenta, 1);

                rowCondVtaDet.DiasVencimiento = this._diasDeVencimiento;

                _dataCondVentaDet.tsa_CondicionesDeVentaDet.ImportRow(rowCondVtaDet);

                ModificarFormaDePago(_idCondicionDeVenta);
                ModificarComprobante(_idCondicionDeVenta);
                ModificarCuenta(_idCondicionDeVenta);
            }
            #endregion
        }
Example #4
0
        /// <summary>
        /// Establece los valores por defecto de tsa_CondicionesDeVentasRow.
        /// </summary>
        public static tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow SetRowDefaultValues(tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow row)
        {        //MIRAR LOS VALORES DE INICIALIZACION
            row.IdCondicionDeVentaDet = Util.NewStringId();
            row.Cuota              = 1;
            row.DiasVencimiento    = 0;
            row.Porcentual         = 100;
            row.FechaCreacion      = mz.erp.businessrules.Sistema.DateTime.Now;
            row.IdConexionCreacion = 1;
            //row.UltimaModificacion = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.IdReservado = 0;
            row.RowId       = Guid.Empty;
            row.IdEmpresa   = Security.IdEmpresa;

            return(row);
        }
Example #5
0
        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);
                }
            }
        }