public FrmPedidoPendienteDetalles(Pedidos owner)
        {
            _owner = owner;
            String fecha_requerido = "";

            InitializeComponent();

            if (String.IsNullOrWhiteSpace(_owner.ObtenerSeleccionPedidos().Cells["REQUERIDO"].Value.ToString()))
            {
                fecha_requerido = null;
            }

            else
            {
                fecha_requerido = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["REQUERIDO"].Value).ToString("dd/MM/yyyy");
            }

            this.labelNumeroPedido.Text = _owner.ObtenerSeleccionPedidos().Cells["CÓDIGO"].Value.ToString();
            this.textBoxCliente.Text = _owner.ObtenerSeleccionPedidos().Cells["CLIENTE"].Value.ToString();
            this.textBoxTransporte.Text = _owner.ObtenerSeleccionPedidos().Cells["TRANSPORTE"].Value.ToString();
            this.textBoxEmpleado.Text = _owner.ObtenerSeleccionPedidos().Cells["RESPONSABLE"].Value.ToString();
            this.textBoxFechaOrdenado.Text = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["ORDENADO"].Value).ToString("dd/MM/yyyy");
            this.textBoxFechaRequerido.Text = fecha_requerido;
            this.textBoxCostoEnvio.Text = Convert.ToDecimal(_owner.ObtenerSeleccionPedidos().Cells["COSTO DE ENVÍO"].Value).ToString("0.00#");
            this.dataGridViewProductos.DataSource = NPedidoDetalles.MostrarPedidoDetalles(Convert.ToInt32(_owner.ObtenerSeleccionPedidos().Cells[1].Value));
            this.dataGridViewProductos.Columns[4].DefaultCellStyle.Format = "0.00# '$'";
            this.dataGridViewProductos.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.dataGridViewProductos.Columns[5].DefaultCellStyle.Format = "0.00# '%'";
            this.dataGridViewProductos.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
        }
        public FrmEditarPedidoEntregado(Pedidos owner)
        {
            InitializeComponent();
            this._owner = owner;

            CargarClientes();
            CargarTransportistas();
            CargarEmpleados();
            CargarProductos();

            this.labelNumeroPedido.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["CÓDIGO"].Value);
            this.comboBoxClientes.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["CLIENTE"].Value);
            this.comboBoxTransportes.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["TRANSPORTE"].Value);
            this.comboBoxEmpleados.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["RESPONSABLE"].Value);
            this.dateTimePickerFechaOrdenado.Text = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["ORDENADO"].Value).ToString("dd/MM/yyyy");
            this.dateTimePickerFechaEntregado.Text = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["ENTREGADO"].Value).ToString("dd/MM/yyyy");
            this.textBoxCostoEnvio.Text = Convert.ToDecimal(_owner.ObtenerSeleccionPedidos().Cells["COSTO DE ENVÍO"].Value).ToString("0.00#");
            //Creamos otra grilla porque no podemos agregar filas a una grilla binded por un data source
            this.dataGridViewOrigen.Hide();
            this.dataGridViewOrigen.DataSource = NPedidoDetalles.MostrarPedidoDetalles(Convert.ToInt32(_owner.ObtenerSeleccionPedidos().Cells[1].Value));

            for (int fila = 0; fila < (this.dataGridViewOrigen.Rows.Count - 1); fila++)
            {
                this.dataGridViewProductos.Rows.Add("", Convert.ToString(this.dataGridViewOrigen.Rows[fila].Cells["PRODUCTO"].Value),
                    Convert.ToInt32(this.dataGridViewOrigen.Rows[fila].Cells["CANT."].Value),
                    Convert.ToDecimal(this.dataGridViewOrigen.Rows[fila].Cells["PRECIO"].Value),
                    Convert.ToDecimal(this.dataGridViewOrigen.Rows[fila].Cells["DESC."].Value));
            }

            this.dataGridViewProductos.Columns[3].DefaultCellStyle.Format = "0.00# '$'";
            this.dataGridViewProductos.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.dataGridViewProductos.Columns[4].DefaultCellStyle.Format = "0.00# '%'";
            this.dataGridViewProductos.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
        }
        public FrmMarcarPendiente(Pedidos owner)
        {
            this._owner = owner;
            InitializeComponent();

            this.labelNombre.Text = String.Format("¿Marcar el Pedido {0} entregado el {1} como Pendiente?",
                this._owner.ObtenerSeleccionPedidos().Cells[2].Value.ToString(),
                Convert.ToDateTime(this._owner.ObtenerSeleccionPedidos().Cells[7].Value).ToString("dd/MM/yyyy"));
        }
        public FrmEditarPedidoPendiente(Pedidos owner)
        {
            InitializeComponent();

            try
            {
                this._owner = owner;

                CargarClientes();
                CargarTransportistas();
                CargarEmpleados();
                CargarProductos();

                this.labelNumeroPedido.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["CÓDIGO"].Value);
                this.comboBoxClientes.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["CLIENTE"].Value);
                this.comboBoxTransportes.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["TRANSPORTE"].Value);
                this.comboBoxEmpleados.Text = Convert.ToString(_owner.ObtenerSeleccionPedidos().Cells["RESPONSABLE"].Value);
                this.dateTimePickerFechaOrdenado.Value = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["ORDENADO"].Value);
                this.textBoxCostoEnvio.Text = Convert.ToDecimal(_owner.ObtenerSeleccionPedidos().Cells["COSTO DE ENVÍO"].Value).ToString("0.00#");

                if (String.IsNullOrWhiteSpace(_owner.ObtenerSeleccionPedidos().Cells["REQUERIDO"].Value.ToString()))
                {
                    this.checkBoxSinFecha.Checked = true;
                }

                else
                {
                    this.checkBoxSinFecha.Checked = false;
                    this.dateTimePickerFechaRequerido.Value = Convert.ToDateTime(_owner.ObtenerSeleccionPedidos().Cells["REQUERIDO"].Value);
                }

                //Creamos otra grilla porque no podemos agregar filas a una grilla binded por un data source
                this.dataGridViewOrigen.Hide();
                this.dataGridViewOrigen.DataSource = NPedidoDetalles.MostrarPedidoDetalles(Convert.ToInt32(_owner.ObtenerSeleccionPedidos().Cells[1].Value));

                for (int fila = 0; fila < (this.dataGridViewOrigen.Rows.Count - 1); fila++)
                {
                    this.dataGridViewProductos.Rows.Add("", Convert.ToString(this.dataGridViewOrigen.Rows[fila].Cells["PRODUCTO"].Value),
                        Convert.ToInt32(this.dataGridViewOrigen.Rows[fila].Cells["CANT."].Value),
                        Convert.ToDecimal(this.dataGridViewOrigen.Rows[fila].Cells["PRECIO"].Value),
                        Convert.ToDecimal(this.dataGridViewOrigen.Rows[fila].Cells["DESC."].Value));
                }

                this.dataGridViewProductos.Columns[3].DefaultCellStyle.Format = "0.00# '$'";
                this.dataGridViewProductos.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                this.dataGridViewProductos.Columns[4].DefaultCellStyle.Format = "0.00# '%'";
                this.dataGridViewProductos.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            }

            catch (Exception ex)
            {
                MensajeError("Datos incompletos. " + ex.Message);
                this._owner.Refrescar();
            }
        }
        public FrmAgregarNuevoPedido(Pedidos owner)
        {
            _owner = owner;
            InitializeComponent();

            CargarClientes();
            CargarTransportistas();
            CargarEmpleados();
            CargarProductos();
            this.dateTimePickerFechaOrdenado.Value = DateTime.Now;
            this.dateTimePickerFechaRequerido.Value = DateTime.Now;
        }
        public FrmInicio()
        {
            InitializeComponent();

            if (pedidos == null)
            {
                pedidos = new Pedidos();
                this.panelContenedor.Controls.Clear();
                this.panelContenedor.Controls.Add(pedidos);
            }
            else
            {
                this.panelContenedor.Controls.Clear();
                this.panelContenedor.Controls.Add(pedidos);
            }
        }
 public void Iniciar()
 {
     pedidos = new Pedidos();
     this.panelContenedor.Controls.Clear();
     this.panelContenedor.Controls.Add(pedidos);
 }
 private void buttonPedidos_Click(object sender, EventArgs e)
 {
     if (pedidos == null)
     {
         pedidos = new Pedidos();
         this.panelContenedor.Controls.Clear();
         this.panelContenedor.Controls.Add(pedidos);
     }
     else
     {
         this.panelContenedor.Controls.Clear();
         this.panelContenedor.Controls.Add(pedidos);
     }
 }
 private void buttonPedidos_Click(object sender, EventArgs e)
 {
     Pedidos controlPedidos = new Pedidos();
     this.panelContainer.Controls.Clear();
     this.panelContainer.Controls.Add(controlPedidos);
 }
Example #10
0
 public void Iniciar()
 {
     pedidos = new Pedidos();
     this.panelContenedor.Controls.Clear();
     this.panelContenedor.Controls.Add(pedidos);
 }