/// <summary>
        /// Envia los cambios del tsa_CondicionesDeVentasDataset a la base de datos.
        /// </summary>
        public static void Update(tsa_CondicionesDeVentasDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.tsa_CondicionesDeVentas.Rows.Count > 0, "La tabla dataSet.tsa_CondicionesDeVentasDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tsa_CondicionesDeVentas.Update(dataSet);
        }
        public static ArrayList RecargosPorCondicionesDeVenta(decimal valor, bool Orden)
        {
            tsa_CondicionesDeVentasDataset _data = GetList(null, null);

            System.Data.DataView _dataordered;
            DataTable            result = VariablesListComparer.FilterDataTable("Productos.Solapas.PreciosPorCondicionDeVenta.ListaDeCondicionesDeVentas", "IdCondicionDeVenta", _data.tsa_CondicionesDeVentas);

            if (Orden)
            {
                _dataordered = new DataView(result, null, "Orden", System.Data.DataViewRowState.CurrentRows);
            }
            else
            {
                _dataordered = new DataView(result, null, "Descripcion", System.Data.DataViewRowState.CurrentRows);
            }
            ArrayList array = new ArrayList();

            for (int i = 0; i < _dataordered.Count; i++)
            {
                System.Data.DataRowView         _row = _dataordered[i];
                ItemsRecargosCondicionesDeVenta item = new ItemsRecargosCondicionesDeVenta();
                item.IdCondicionDeVenta = Convert.ToString(_row["IdCondicionDeVenta"]);
                item.Descripcion        = Convert.ToString(_row["Descripcion"]);
                item.PorcentajeRecargo  = System.Math.Round(Convert.ToDecimal(_row["Recargo"]), 2);
                item.Recargo            = System.Math.Round(Convert.ToDecimal(valor * item.PorcentajeRecargo / 100), 2);
                item.Importe            = System.Math.Round(Convert.ToDecimal(valor + valor * Convert.ToDecimal(_row["Recargo"]) / 100), 2);
                array.Add(item);
            }
            return(array);
        }
示例#3
0
        public CuentaCondicionesDeVenta GetCondicionesDeVenta(string CodigoCuenta)
        {
            string IdCuenta = tsa_Cuentas.GetPkByUk(CodigoCuenta);

            _idCuenta = IdCuenta;

            CuentaCondicionesDeVenta       condiciones = new CuentaCondicionesDeVenta();
            tsa_CondicionesDeVentasDataset Datacv      = tsa_CondicionesDeVentas.GetList();

            foreach (tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow Rowcv in Datacv.tsa_CondicionesDeVentas.Rows)
            {
                /* Silvina 20100602 - Tarea 777 */
                Cuentas ctas = tsa_CuentasCondicionesDeVenta_TDCompTesoreria.GetCuentas(Rowcv.IdCondicionDeVenta);
                if ((ctas.Count != 0) && ((Cuenta)ctas[0]).MetodoDeAsignacion.ToUpper().Equals("I"))
                {
                    /* Fin Silvina */
                    CuentaCondicionDeVenta condicion = new CuentaCondicionDeVenta();
                    condicion.Descripcion        = Rowcv.Descripcion;
                    condicion.IdCondicionDeVenta = Rowcv.IdCondicionDeVenta;
                    condicion.Valor = businessrules.tsa_CuentasCondicionesDeVenta_TDCompTesoreria.GetActivo(IdCuenta, Rowcv.IdCondicionDeVenta, null);
                    condiciones.AddProductoImpuesto(condicion);
                }
            }
            return(condiciones);
        }
        public static DataSet GetList([SearchParameterInfo("IdCondicionDeVenta", IsAlternativePrimaryKey = true)] string IdCondicionDeVenta,
                                      [SearchParameterInfo("Descripcion", IsDescription = true)] string Descripcion
                                      )
        {
            tsa_CondicionesDeVentasDataset data = mz.erp.businessrules.tsa_CondicionesDeVentas.GetList(IdCondicionDeVenta, Descripcion);

            return(( DataSet )data);
        }
示例#5
0
 public void Commit()
 {
     _condicionDeVenta.Commit();
     _dataCondVenta    = _condicionDeVenta.DataCondicionDeVenta;
     _dataCondVentaDet = _condicionDeVenta.DataCondicionDeVentaDet;
     _dataTDCompTesoreria_CondVenta            = _condicionDeVenta.DataTDComp_Tesoreria_CondDeVenta;
     _dataTiposDeCompTDCompTesoreriaCondVentas = _condicionDeVenta.DataTiposDeComp_Tesoreria_CondVenta;
     _dataCuentasTDCompTesoreriaCondVentas     = _condicionDeVenta.DataCuenta_TDComp_Tesoreria;
 }
示例#6
0
        public static tsa_CondicionesDeVentasExDataset NewRow()
        {
            tsa_CondicionesDeVentasExDataset dataEx = new tsa_CondicionesDeVentasExDataset();

            tsa_CondicionesDeVentasDataset data = new tsa_CondicionesDeVentasDataset();

            System.Data.DataRow row = mz.erp.businessrules.tsa_CondicionesDeVentas.NewRow();
            try
            {
                dataEx.tsa_CondicionesDeVentas.LoadDataRow(row.ItemArray, false);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            return(dataEx);
        }
示例#7
0
        public static tsa_CondicionesDeVentasDataset GetCondicionesDeVentaByIdTDCompTesoreria(string IdTDCompTesoreria)
        {
            tsa_CondicionesDeVentasDataset data = new tsa_CondicionesDeVentasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentas");

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentas_GetListByIdTDCompTesoreria", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdTDCompTesoreria", SqlDbType.VarChar));
            cmd.Parameters["@IdTDCompTesoreria"].Value = IdTDCompTesoreria;

            adapter.SelectCommand = cmd;
            adapter.Fill(data);
            return(data);
        }
        public static ArrayList GetCondicionesDeVentas()
        {
            ArrayList resutl = new ArrayList();
            tsa_CondicionesDeVentasDataset _data = GetList(null, null);

            foreach (DataRow row in _data.Tables["tsa_CondicionesDeVentas"].Rows)
            {
                CondicionDeVentaView cdvv = new CondicionDeVentaView();
                cdvv.IdCondicionDeVenta = Convert.ToString(row["IdCondicionDeVenta"]);
                cdvv.Descripcion        = Convert.ToString(row["Descripcion"]);
                if (row.IsNull("Orden"))
                {
                    cdvv.Orden = int.MaxValue;
                }
                else
                {
                    cdvv.Orden = Convert.ToInt32(row["Orden"]);
                }
                cdvv.Recargo = Convert.ToDecimal(row["Recargo"]);
                resutl.Add(cdvv);
            }
            return(resutl);
        }
示例#9
0
        public static tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow GetByPk(string IdCondicionDeVenta)
        {
            tsa_CondicionesDeVentasDataset data = new tsa_CondicionesDeVentasDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentas_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdCondicionDeVenta", SqlDbType.VarChar));
            cmd.Parameters["@IdCondicionDeVenta"].Value = IdCondicionDeVenta;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentas");

            adapter.Fill(data);

            if (data.tsa_CondicionesDeVentas.Rows.Count == 1)
            {
                return((tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow)data.tsa_CondicionesDeVentas.Rows[0]);
            }

            return(null);
        }
示例#10
0
        public static tsa_CondicionesDeVentasDataset GetList(string IdCondicionDeVenta, string Descripcion, bool Activo)
        {
            tsa_CondicionesDeVentasDataset data = new tsa_CondicionesDeVentasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentas");

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentas_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdCondicionDeVenta", SqlDbType.VarChar));
            cmd.Parameters["@IdCondicionDeVenta"].Value = IdCondicionDeVenta;
            cmd.Parameters.Add(new SqlParameter("@Descripcion", SqlDbType.VarChar));
            cmd.Parameters["@Descripcion"].Value = Descripcion;
            cmd.Parameters.Add(new SqlParameter("@Activo", SqlDbType.Bit));
            cmd.Parameters["@Activo"].Value = Activo;
            adapter.SelectCommand           = cmd;

            adapter.Fill(data);

            return(data);
        }
示例#11
0
        public static tsa_CondicionesDeVentasDataset GetList()
        {
            tsa_CondicionesDeVentasDataset data = new tsa_CondicionesDeVentasDataset();

            return(( tsa_CondicionesDeVentasDataset )GetList(data));
        }
示例#12
0
 public static void Update(tsa_CondicionesDeVentasDataset dataSet)
 {
     Update(dataSet.tsa_CondicionesDeVentas);
 }