public static void Update(tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaDataTable)row.Table).Addtfi_TDCompTesoreria_CondicionesDeVentaRow(row);
            }

            Update(row.Table);
        }
示例#2
0
        public static void UpdateWithValidation(tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
        public void Commit()
        {
            if (this._state.ToUpper().Equals("NEW"))
            {
                _dataTDCompTesoreriaCondVentas            = new tfi_TDCompTesoreria_CondicionesDeVentaDataset();
                _dataCuentasTDCompTesoreriaCondVentas     = new tsa_CuentasCondicionesDeVenta_TDCompTesoreriaDataset();
                _dataTiposDeCompTDCompTesoreriaCondVentas = new Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset();
                foreach (CondicionDeVentaView cdv in this._listaCondicionesDeVentasSeleccionadas)
                {
                    tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row_TDCT_CV = this._dataTDCompTesoreriaCondVentas.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
                    mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(row_TDCT_CV);
                    row_TDCT_CV.idCondicionDeVenta = cdv.IdCondicionDeVenta;
                    if (_metodoComparacionXE)
                    {
                        row_TDCT_CV.MetodoDeComparacion = "E";
                    }
                    else
                    if (_metodoComparacionXI)
                    {
                        row_TDCT_CV.MetodoDeComparacion = "I";
                    }
                    this._dataTDCompTesoreriaCondVentas.tfi_TDCompTesoreria_CondicionesDeVenta.Addtfi_TDCompTesoreria_CondicionesDeVentaRow(row_TDCT_CV);

                    foreach (TipoDeComprobante tcv in this.ListaTiposDeComprobantesSeleccionados)
                    {
                        Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow row_TC_CV_TDCT = this._dataTiposDeCompTDCompTesoreriaCondVentas.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.NewTsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow();
                        mz.erp.businessrules.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.SetRowDefaultValues(row_TC_CV_TDCT);
                        row_TC_CV_TDCT.IdCondicionDeVenta  = cdv.IdCondicionDeVenta;
                        row_TC_CV_TDCT.IdTipoDeComprobante = tcv.IdTipoComprobante;
                        if (_metodoAsigTipoCompXE)
                        {
                            row_TC_CV_TDCT.MetodoDeAsignacion = "E";
                        }
                        else
                        if (_metodoAsigTipoCompXI)
                        {
                            row_TC_CV_TDCT.MetodoDeAsignacion = "I";
                        }
                        this._dataTiposDeCompTDCompTesoreriaCondVentas.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.AddTsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow(row_TC_CV_TDCT);
                    }
                    foreach (Cuenta c in this._listaCuentas)
                    {
                        tsa_CuentasCondicionesDeVenta_TDCompTesoreriaDataset.tsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow row_C_CV_TDCT = this._dataCuentasTDCompTesoreriaCondVentas.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.Newtsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow();
                        mz.erp.businessrules.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.SetRowDefaultValues(row_C_CV_TDCT);
                        row_C_CV_TDCT.IdCondicionDeVenta = cdv.IdCondicionDeVenta;
                        row_C_CV_TDCT.IdCuenta           = c.IdCuenta;
                        if (_metodoAsigCuentaXE)
                        {
                            row_C_CV_TDCT.MetodoDeAsignacion = "E";
                        }
                        else
                        if (_metodoAsigCuentaXI)
                        {
                            row_C_CV_TDCT.MetodoDeAsignacion = "I";
                        }
                        this._dataCuentasTDCompTesoreriaCondVentas.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.Addtsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow(row_C_CV_TDCT);
                    }
                }
                tfi_TDCompTesoreriasMonedasRecargosDataset.tfi_TDCompTesoreriasMonedasRecargosRow row_TDCT_M_R = this._dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Newtfi_TDCompTesoreriasMonedasRecargosRow();
                mz.erp.businessrules.tfi_TDCompTesoreriasMonedasRecargos.SetRowDefaultValues(row_TDCT_M_R);
                row_TDCT_M_R.Recargo  = this._recargo;
                row_TDCT_M_R.IdMoneda = Variables.GetValueString("Contabilidad.MonedaReferencia");
                this._dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Addtfi_TDCompTesoreriasMonedasRecargosRow(row_TDCT_M_R);
            }
            if (this._state.ToUpper().Equals("EDIT"))
            {
                tfi_TDCompTesoreriasMonedasRecargosDataset.tfi_TDCompTesoreriasMonedasRecargosRow row_TDCT_M_R;
                if (_dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Rows.Count > 0)
                {
                    row_TDCT_M_R         = (tfi_TDCompTesoreriasMonedasRecargosDataset.tfi_TDCompTesoreriasMonedasRecargosRow)_dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Rows[0];
                    row_TDCT_M_R.Recargo = this._recargo;
                }
                else
                {
                    row_TDCT_M_R = this._dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Newtfi_TDCompTesoreriasMonedasRecargosRow();
                    mz.erp.businessrules.tfi_TDCompTesoreriasMonedasRecargos.SetRowDefaultValues(row_TDCT_M_R);
                    row_TDCT_M_R.Recargo  = this._recargo;
                    row_TDCT_M_R.IdMoneda = Variables.GetValueString("Contabilidad.MonedaReferencia");
                    this._dataTDCompTesoreriaMonedaRecargos.tfi_TDCompTesoreriasMonedasRecargos.Addtfi_TDCompTesoreriasMonedasRecargosRow(row_TDCT_M_R);
                }
            }
        }
        public void Commit()
        {
            if (_estado == "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;
                          *     rowCondVta.MetodoDeAsignacion = this._metodoDeAsignacion;
                          *
                          */
                tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDCompTes_ConVta = _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
                mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(rowTDCompTes_ConVta);
                rowTDCompTes_ConVta.idTDCompTesoreria   = this.IdTDCompTesoreria;
                rowTDCompTes_ConVta.MetodoDeComparacion = this.MetodoDeComparacion;

                _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Rows.Add(rowTDCompTes_ConVta);
                _formasDePago.Add(rowTDCompTes_ConVta);
            }

            /*else
             * {  estado = "MODIFY"
             *      tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow row = mz.erp.dataaccess.tsa_CondicionesDeVentas.GetByPk(_idCondicionDeVenta);
             * }*/
        }
示例#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);
                }
            }
        }
示例#6
0
        private void ModificarFormaDePago(string IdCondicionDeVenta)
        {
            if (this.ListaFormasDePagoSeleccionadas.Count == 0 && _diasDeVencimiento != 0)
            {
                bool _insertarNull = true;

                tfi_TDCompTesoreria_CondicionesDeVentaDataset dataAux = tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null, null, IdCondicionDeVenta);
                foreach (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row in dataAux.tfi_TDCompTesoreria_CondicionesDeVenta.Rows)
                {
                    if (row.IsidTDCompTesoreriaNull())
                    {
                        _insertarNull = false;
                    }
                }
                if (_insertarNull)
                {
                    tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDCompTes_ConVta = _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
                    mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(rowTDCompTes_ConVta);
                    rowTDCompTes_ConVta.idTDCompTesoreria   = null;
                    rowTDCompTes_ConVta.MetodoDeComparacion = this._metodoComparacion;
                    _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Addtfi_TDCompTesoreria_CondicionesDeVentaRow(rowTDCompTes_ConVta);
                }
            }

            bool agregue = false;

            foreach (FormaDePago fp in this.FormasDePago)
            {
                if (fp.Agregada)
                {
                    #region No vino de la BD

                    if (!fp.SourceBD)
                    {// Agregar Forma de Pago
                        tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDCompTes_ConVta = _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
                        mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(rowTDCompTes_ConVta);
                        rowTDCompTes_ConVta.idTDCompTesoreria = fp.IdFormaDePago;
                        this._idTDComp.Add(fp.IdFormaDePago);
                        rowTDCompTes_ConVta.MetodoDeComparacion = this._metodoComparacion;
                        _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Addtfi_TDCompTesoreria_CondicionesDeVentaRow(rowTDCompTes_ConVta);

                        foreach (TipoDeComprobante tc in this.ListaTiposDeComprobantesSeleccionados)
                        {
                            if (tc.SourceBD)
                            {
                                Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow row_TC_CV_TDCT = this._dataTiposDeCompTDCompTesoreriaCondVentas.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.NewTsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow();
                                mz.erp.businessrules.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.SetRowDefaultValues(row_TC_CV_TDCT);
                                row_TC_CV_TDCT.IdTipoDeComprobante = tc.IdTipoComprobante;
                                row_TC_CV_TDCT.MetodoDeAsignacion  = this.MetodoDeAsignacionTipoDeComprobante;
                                row_TC_CV_TDCT.IdTDCompTesoreria   = fp.IdFormaDePago;
                                _dataTiposDeCompTDCompTesoreriaCondVentas.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.AddTsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow(row_TC_CV_TDCT);
                            }
                        }

                        agregue = true;

                        foreach (Cuenta cta in this.ListaCuentas)
                        {
                            if (cta.SourceBD)
                            {
                                tsa_CuentasCondicionesDeVenta_TDCompTesoreriaDataset.tsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow row_C_CV_TDCT = this._dataCuentasTDCompTesoreriaCondVentas.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.Newtsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow();
                                mz.erp.businessrules.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.SetRowDefaultValues(row_C_CV_TDCT);
                                row_C_CV_TDCT.IdCuenta           = cta.IdCuenta;
                                row_C_CV_TDCT.MetodoDeAsignacion = this.MetodoDeAsignacionCuenta;
                                row_C_CV_TDCT.idTDCompTesoreria  = fp.IdFormaDePago;
                                _dataCuentasTDCompTesoreriaCondVentas.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.Addtsa_CuentasCondicionesDeVenta_TDCompTesoreriaRow(row_C_CV_TDCT);
                            }
                        }
                    }
                    #endregion
                    /* Silvina 20100601 - Tarea 767 */
                    else
                    {
                        tfi_TDCompTesoreria_CondicionesDeVentaDataset data = tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null, fp.IdFormaDePago, _idCondicionDeVenta);
                        foreach (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row in data.tfi_TDCompTesoreria_CondicionesDeVenta.Rows)
                        {
                            foreach (FormaDePago fps in this.ListaFormasDePagoSeleccionadas)
                            {
                                // if (!row.IsIdTDCompTesoreriaNull() && fp.IdFormaDePago.Equals(row.IdTDCompTesoreria))
                                if (fps.SourceBD && fps.Agregada && fps.IdFormaDePago.Equals(row.idTDCompTesoreria))
                                {
                                    row.MetodoDeComparacion = this.MetodoComparacion;
                                    _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.ImportRow(row);
                                }
                            }
                        }
                    }
                    /* Fin Silvina */
                }
                else
                {
                    #region vino de la BD
                    if (fp.SourceBD)
                    {                    /* Borrar Forma de Pago
                                          *     Tambien hay que borrarlo de Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria
                                          *     y de tsa_CuentasCondicionesDeVenta_TDCompTesoreria */
                        //Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset dataComprobantes = mz.erp.dataaccess.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.GetList(null,fp.IdTDComprobante,fp.IdFormaDePago,IdCondicionDeVenta);
                        Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset dataComprobantes = mz.erp.dataaccess.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.GetList(null, null, fp.IdFormaDePago, IdCondicionDeVenta);
                        foreach (Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow rowTDComp in dataComprobantes.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows)
                        {
                            rowTDComp.Delete();
                        }

                        _dataTiposDeCompTDCompTesoreriaCondVentas.Merge(dataComprobantes);

                        DataSet data = mz.erp.dataaccess.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.GetList(null, IdCondicionDeVenta, fp.IdFormaDePago);

                        foreach (DataRow rowCuenta in data.Tables["tsa_CuentasCondicionesDeVenta_TDCompTesoreria"].Rows)
                        {
                            rowCuenta.Delete();
                        }
                        _dataCuentasTDCompTesoreriaCondVentas.Merge(data);

                        // Borra de tfi_TDCompTesoreria_CondicionesDeVenta
                        //_dataTDCompTesoreria_CondVenta = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null,fp.IdFormaDePago,IdCondicionDeVenta);
                        //_dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Rows[0].Delete();


                        tfi_TDCompTesoreria_CondicionesDeVentaDataset dataTDComp = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null, fp.IdFormaDePago, IdCondicionDeVenta);
                        foreach (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDComp in dataTDComp.tfi_TDCompTesoreria_CondicionesDeVenta.Rows)
                        {
                            rowTDComp.Delete();
                        }
                        _dataTDCompTesoreria_CondVenta.Merge(dataTDComp);
                    }
                    #endregion
                }
            }

            if (agregue)
            {
                tfi_TDCompTesoreria_CondicionesDeVentaDataset dataAux = tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null, null, IdCondicionDeVenta);
                foreach (tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row in dataAux.tfi_TDCompTesoreria_CondicionesDeVenta.Rows)
                {
                    if (row.IsidTDCompTesoreriaNull())
                    {
                        row.Delete();
                        _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.ImportRow(row);
                    }
                }

                Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset dataComprobantes = mz.erp.dataaccess.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.GetList(null, null, null, IdCondicionDeVenta);
                foreach (Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaDataset.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreriaRow rowTDComp in dataComprobantes.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.Rows)
                {
                    if (rowTDComp.IsIdTDCompTesoreriaNull())
                    {
                        rowTDComp.Delete();
                        _dataTiposDeCompTDCompTesoreriaCondVentas.Tsy_TiposDeComprobantes_CondicionesDeVenta_TDCompTesoreria.ImportRow(rowTDComp);
                    }
                }
            }
        }
示例#7
0
 private void AgregarFormaDePago()
 {
     if (this._listaFormasDePagoSeleccionadas.Count == 0)
     {
         tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDCompTes_ConVta = _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
         mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(rowTDCompTes_ConVta);
         rowTDCompTes_ConVta.idTDCompTesoreria   = null;
         rowTDCompTes_ConVta.MetodoDeComparacion = this._metodoComparacion;
         _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Addtfi_TDCompTesoreria_CondicionesDeVentaRow(rowTDCompTes_ConVta);
     }
     else
     {
         foreach (FormaDePago fp in this._listaFormasDePagoSeleccionadas)
         {
             tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow rowTDCompTes_ConVta = _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Newtfi_TDCompTesoreria_CondicionesDeVentaRow();
             mz.erp.businessrules.tfi_TDCompTesoreria_CondicionesDeVenta.SetRowDefaultValues(rowTDCompTes_ConVta);
             rowTDCompTes_ConVta.idTDCompTesoreria = fp.IdFormaDePago;
             this._idTDComp.Add(fp.IdFormaDePago);
             rowTDCompTes_ConVta.MetodoDeComparacion = this._metodoComparacion;
             _dataTDCompTesoreria_CondVenta.tfi_TDCompTesoreria_CondicionesDeVenta.Addtfi_TDCompTesoreria_CondicionesDeVentaRow(rowTDCompTes_ConVta);
         }
     }
 }
示例#8
0
        /// <summary>
        /// Establece los valores por defecto de tfi_TDCompTesoreria_CondicionesDeVentaRow.
        /// </summary>
        public static tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow SetRowDefaultValues(tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row)
        {
            row.IdTDCompTesoreria_CondicionesDeVenta = Util.NewStringId();
            row.idTDCompTesoreria   = string.Empty;
            row.idCondicionDeVenta  = string.Empty;
            row.MetodoDeComparacion = string.Empty;
            row.FechaCreacion       = DateTime.Now;
            row.IdConexionCreacion  = Security.IdConexion;
            //row.UltimaModificacion = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.IdReservado = 0;
            row.RowId       = Guid.Empty;
            row.IdEmpresa   = Security.IdEmpresa;
            row.IdSucursal  = Security.IdSucursal;
            row.IdProceso   = 0;
            row.IdTarea     = 0;

            return(row);
        }
示例#9
0
 /// <summary>
 /// Obtiene un registro de la tabla tfi_TDCompTesoreria_CondicionesDeVenta que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow GetByPk(string IdTDCompTesoreria_CondicionesDeVenta)
 {
     tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetByPk(IdTDCompTesoreria_CondicionesDeVenta);
     foreach (DataColumn dc in row.Table.Columns)
     {
         if (row[dc] == System.DBNull.Value)
         {
             row[dc] = Util.DefaultValue(dc.DataType);
         }
     }
     return(row);
 }
示例#10
0
        /// <summary>
        /// Valida un tfi_TDCompTesoreria_CondicionesDeVentaRow.
        /// </summary>
        public static bool RowIsValid(tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


            if (!IdTDCompTesoreria_CondicionesDeVentaIsValid(row.IdTDCompTesoreria_CondicionesDeVenta, out mensaje))
            {
                row.SetColumnError("IdTDCompTesoreria_CondicionesDeVenta", mensaje);
                isValid = false;
            }

            if (!idTDCompTesoreriaIsValid(row.idTDCompTesoreria, out mensaje))
            {
                row.SetColumnError("idTDCompTesoreria", mensaje);
                isValid = false;
            }

            if (!idCondicionDeVentaIsValid(row.idCondicionDeVenta, out mensaje))
            {
                row.SetColumnError("idCondicionDeVenta", mensaje);
                isValid = false;
            }

            if (!MetodoDeComparacionIsValid(row.MetodoDeComparacion, out mensaje))
            {
                row.SetColumnError("MetodoDeComparacion", mensaje);
                isValid = false;
            }

            if (!FechaCreacionIsValid(row.FechaCreacion, out mensaje))
            {
                row.SetColumnError("FechaCreacion", mensaje);
                isValid = false;
            }

            if (!IdConexionCreacionIsValid(row.IdConexionCreacion, out mensaje))
            {
                row.SetColumnError("IdConexionCreacion", mensaje);
                isValid = false;
            }

            if (!UltimaModificacionIsValid(row.UltimaModificacion, out mensaje))
            {
                row.SetColumnError("UltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdConexionUltimaModificacionIsValid(row.IdConexionUltimaModificacion, out mensaje))
            {
                row.SetColumnError("IdConexionUltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdReservadoIsValid(row.IdReservado, out mensaje))
            {
                row.SetColumnError("IdReservado", mensaje);
                isValid = false;
            }

            if (!RowIdIsValid(row.RowId, out mensaje))
            {
                row.SetColumnError("RowId", mensaje);
                isValid = false;
            }

            if (!IdEmpresaIsValid(row.IdEmpresa, out mensaje))
            {
                row.SetColumnError("IdEmpresa", mensaje);
                isValid = false;
            }

            if (!IdSucursalIsValid(row.IdSucursal, out mensaje))
            {
                row.SetColumnError("IdSucursal", mensaje);
                isValid = false;
            }

            if (!IdProcesoIsValid(row.IdProceso, out mensaje))
            {
                row.SetColumnError("IdProceso", mensaje);
                isValid = false;
            }

            if (!IdTareaIsValid(row.IdTarea, out mensaje))
            {
                row.SetColumnError("IdTarea", mensaje);
                isValid = false;
            }
            ;

            return(isValid);
        }
示例#11
0
        /// <summary>
        /// Envia los cambios del tfi_TDCompTesoreria_CondicionesDeVentaRow a la base de datos.
        /// </summary>
        public static void Update(tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.Update(row);
        }