Example #1
0
        private void btnGuardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int xRow = 0;

            dtgPrePedidos.FocusedView.CloseEditor();
            for (int i = 0; i < dtgValPrePedidos.RowCount; i++)
            {
                xRow = dtgValPrePedidos.GetVisibleRowHandle(i);
                if (Convert.ToBoolean(dtgValPrePedidos.GetRowCellValue(xRow, "Seleccionar")))
                {
                    CLS_Pedidos udp = new CLS_Pedidos();
                    udp.PrePedidosId = Convert.ToInt32(dtgValPrePedidos.GetRowCellValue(xRow, "PrePedidosId").ToString());
                    if (radioGroup1.SelectedIndex == 0)
                    {
                        udp.Opcion = 1;
                    }
                    else if (radioGroup1.SelectedIndex == 1)
                    {
                        udp.Opcion = 2;
                    }
                    else
                    {
                        udp.Opcion = 3;
                    }
                    udp.MtdActualizarPrePedidoEstatus();
                    if (!udp.Exito)
                    {
                        XtraMessageBox.Show(udp.Mensaje);
                    }
                }
            }
            btnBuscar.PerformClick();
        }
Example #2
0
        private void GuardarDistribucion()
        {
            CLS_Pedidos insdet = new CLS_Pedidos();

            insdet.PedidosId      = PedidosId;
            insdet.ArticuloCodigo = CodigoArticulo;
            insdet.DAlmacen       = Convert.ToInt32(DAlmacen);
            insdet.DApatzingan    = Convert.ToInt32(DApatzingan);
            insdet.DCalzada       = Convert.ToInt32(DCalzada);
            insdet.DCentro        = Convert.ToInt32(DCentro);
            insdet.DCostaRica     = Convert.ToInt32(DCostaRica);
            insdet.DEstocolmo     = Convert.ToInt32(DEstocolmo);
            insdet.DFcoVilla      = Convert.ToInt32(DFcoVilla);
            insdet.DLombardia     = Convert.ToInt32(DLombardia);
            insdet.DReyes         = Convert.ToInt32(DLosReyes);
            insdet.DMorelos       = Convert.ToInt32(DMorelos);
            insdet.DNvaItalia     = Convert.ToInt32(DNvaItalia);
            insdet.DPaseo         = Convert.ToInt32(DPaseo);
            insdet.DSarabiaI      = Convert.ToInt32(DSarabiaI);
            insdet.DSarabiaII     = Convert.ToInt32(DSarabiaII);
            insdet.TPedido        = Convert.ToInt32(TPedido);
            insdet.MtdInsertPedidoDetalleProveedor();
            if (!insdet.Exito)
            {
                XtraMessageBox.Show(insdet.Mensaje, "Error al guardar el Registro");
            }
        }
Example #3
0
        private void CargarProveedores(int?Valor)
        {
            CLS_Pedidos ConProv = new CLS_Pedidos();

            ConProv.MtdSeleccionarPrePedidosProveedores();
            if (ConProv.Exito)
            {
                cmbProveedores.Properties.DisplayMember = "ProveedorNombre";
                cmbProveedores.Properties.ValueMember   = "Proveedorid";
                cmbProveedores.EditValue             = Valor;
                cmbProveedores.Properties.DataSource = ConProv.Datos;
            }
        }
Example #4
0
        private void CargarParametros()
        {
            CLS_Pedidos ins = new CLS_Pedidos();

            ins.MtdSeleccionarParametrosPedidos();
            if (ins.Exito)
            {
                if (ins.Datos.Rows.Count > 0)
                {
                    txtRuta.Text = ins.Datos.Rows[0]["PedidosConfigRuta"].ToString();
                }
            }
        }
Example #5
0
 private void btnGuardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (txtRuta.Text != string.Empty)
     {
         CLS_Pedidos ins = new CLS_Pedidos();
         ins.PedidosConfigRuta = txtRuta.Text;
         ins.MtdInsertarParametrosPedidos();
         if (!ins.Exito)
         {
             XtraMessageBox.Show(ins.Mensaje);
         }
         else
         {
             XtraMessageBox.Show("Parametros Guardados con exito");
         }
     }
     else
     {
         XtraMessageBox.Show("No existe ruta a guardar");
     }
 }
Example #6
0
        private void Frm_Pre_Pedidos_Buscar_Shown(object sender, EventArgs e)
        {
            dtgValPrePedidos.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFullFocus;
            dtgValPrePedidos.OptionsSelection.EnableAppearanceFocusedCell = false;
            CLS_Pedidos selpro = new CLS_Pedidos();

            selpro.PrePedidoCerrado    = 0;
            selpro.PrePedidosCancelado = 0;
            selpro.MtdSeleccionarPrePedidos();
            if (selpro.Exito)
            {
                if (selpro.Datos.Rows.Count > 0)
                {
                    dtgPrePedidos.DataSource = selpro.Datos;
                }
            }
            else
            {
                XtraMessageBox.Show(selpro.Mensaje);
            }
            lblProveedor.Caption = "Proveedor:";
        }
Example #7
0
 private void btnBuscar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (chkTodos.Checked == true)
     {
         CLS_Pedidos sel = new CLS_Pedidos();
         sel.ProveedorId = 0;
         if (radioGroup1.SelectedIndex == 0)
         {
             sel.Opcion = 1;
         }
         else if (radioGroup1.SelectedIndex == 1)
         {
             sel.Opcion = 2;
         }
         else
         {
             sel.Opcion = 3;
         }
         sel.MtdSeleccionarPrePedidoListaEstatus();
         if (sel.Exito)
         {
             if (sel.Datos.Rows.Count > 0)
             {
                 dtgPrePedidos.DataSource = sel.Datos;
             }
             else
             {
                 XtraMessageBox.Show("No existen registros para mostrar");
             }
         }
         else
         {
             XtraMessageBox.Show(sel.Mensaje);
         }
     }
     else
     {
         if (cmbProveedores.EditValue != null)
         {
             CLS_Pedidos sel = new CLS_Pedidos();
             sel.ProveedorId = Convert.ToInt32(cmbProveedores.EditValue);
             if (radioGroup1.SelectedIndex == 0)
             {
                 sel.Opcion = 1;
             }
             else if (radioGroup1.SelectedIndex == 1)
             {
                 sel.Opcion = 2;
             }
             else
             {
                 sel.Opcion = 3;
             }
             sel.MtdSeleccionarPrePedidoListaEstatus();
             if (sel.Exito)
             {
                 if (sel.Datos.Rows.Count > 0)
                 {
                     dtgPrePedidos.DataSource = sel.Datos;
                 }
                 else
                 {
                     XtraMessageBox.Show("No existen registros para mostrar");
                 }
             }
             else
             {
                 XtraMessageBox.Show(sel.Mensaje);
             }
         }
         else
         {
             XtraMessageBox.Show("No se ha seleccionado Proveedor");
         }
     }
 }
Example #8
0
        private void btnBuscar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            dtgPedidos.DataSource = null;
            CLS_Pedidos selped  = new CLS_Pedidos();
            DateTime    FInicio = Convert.ToDateTime(dtInicio.EditValue.ToString());
            DateTime    FFin    = Convert.ToDateTime(dtFin.EditValue.ToString());

            if (chkFecha.Checked == true && chkProveedor.Checked == true)
            {
                int result = DateTime.Compare(FInicio, FFin);
                if (result < 1)
                {
                    if (txtProveedorId.Text != string.Empty)
                    {
                        selped.FechaInicio = string.Format("{0}{1}{2} 00:00:00", FInicio.Year, DosCeros(FInicio.Month.ToString()), DosCeros(FInicio.Day.ToString()));
                        selped.FechaFin    = string.Format("{0}{1}{2} 23:59:59", FFin.Year, DosCeros(FFin.Month.ToString()), DosCeros(FFin.Day.ToString()));
                        selped.ProveedorId = Convert.ToInt32(txtProveedorId.Text);
                        if (rdgTipoPedido.SelectedIndex == 0)
                        {
                            selped.Opcion = 1;
                        }
                        else if (rdgTipoPedido.SelectedIndex == 1)
                        {
                            selped.Opcion = 2;
                        }
                        else if (rdgTipoPedido.SelectedIndex == 2)
                        {
                            selped.Opcion = 4;
                        }
                        else if (rdgTipoPedido.SelectedIndex == 3)
                        {
                            selped.Opcion = 3;
                        }
                        selped.MtdSeleccionarPedidoFechaProveedorLista();
                    }
                    else
                    {
                        XtraMessageBox.Show("Falta Ingrasar un Proveedor");
                    }
                }
                else
                {
                    XtraMessageBox.Show("La fecha de Inicio no puede ser mayor a la Fecha Fin");
                }
            }
            else if (chkFecha.Checked == false && chkProveedor.Checked == true)
            {
                if (txtProveedorId.Text != string.Empty)
                {
                    selped.ProveedorId = Convert.ToInt32(txtProveedorId.Text);
                    if (rdgTipoPedido.SelectedIndex == 0)
                    {
                        selped.Opcion = 1;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 1)
                    {
                        selped.Opcion = 2;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 2)
                    {
                        selped.Opcion = 4;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 3)
                    {
                        selped.Opcion = 3;
                    }
                    selped.MtdSeleccionarPedidoProveedorLista();
                }
                else
                {
                    XtraMessageBox.Show("Falta Ingrasar un Proveedor");
                }
            }
            else if (chkFecha.Checked == true && chkProveedor.Checked == false)
            {
                int result = DateTime.Compare(FInicio, FFin);
                if (result < 1)
                {
                    selped.FechaInicio = string.Format("{0}{1}{2} 00:00:00", FInicio.Year, DosCeros(FInicio.Month.ToString()), DosCeros(FInicio.Day.ToString()));
                    selped.FechaFin    = string.Format("{0}{1}{2} 23:59:59", FFin.Year, DosCeros(FFin.Month.ToString()), DosCeros(FFin.Day.ToString()));
                    if (rdgTipoPedido.SelectedIndex == 0)
                    {
                        selped.Opcion = 1;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 1)
                    {
                        selped.Opcion = 2;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 2)
                    {
                        selped.Opcion = 4;
                    }
                    else if (rdgTipoPedido.SelectedIndex == 3)
                    {
                        selped.Opcion = 3;
                    }
                    selped.MtdSeleccionarPedidoFechaLista();
                }
                else
                {
                    XtraMessageBox.Show("La fecha de Inicio no puede ser mayor a la Fecha Fin");
                }
            }

            if (selped.Exito)
            {
                if (selped.Datos.Rows.Count > 0)
                {
                    dtgPedidos.DataSource = selped.Datos;
                }
                else
                {
                    XtraMessageBox.Show("No existen registros para mostrar");
                }
            }
        }