예제 #1
0
        private void TXfactura_LostFocus(object sender, RoutedEventArgs e)
        {
            //return;
            if (CmbTipoDoc.SelectedIndex < 0)
            {
                MessageBox.Show("Seleccione tipo de documento...");
                TXfactura.BorderBrush = Brushes.Red;
                CmbTipoDoc.Focus();
                return;
            }
            if (TXfactura.Text == "")
            {
                bandera = false;
                return;
            }
            string tipodoc = "005";

            if (CmbTipoDoc.SelectedIndex == 0)
            {
                tipodoc = "004";
            }

            if (BuscarFactura(TXfactura.Text, tipodoc) == false)
            {
                MessageBox.Show("La factura ingresada no existe");
                TXfactura.BorderBrush = Brushes.Red;
                bandera = false;
            }
            else
            {
                bandera = true;
                TXfactura.BorderBrush = Brushes.Gray;
            }
        }
예제 #2
0
        private void BTNvalidar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (CmbTipoDoc.SelectedIndex < 0)
                {
                    MessageBox.Show("Seleccione tipo de documento a validar");
                    CmbTipoDoc.Focus();
                    return;
                }
                string tipodoc = "005";
                if (CmbTipoDoc.SelectedIndex == 0)
                {
                    tipodoc = "004";
                }

                if (BuscarFactura(TXfactura.Text, tipodoc) == false)
                {
                    MessageBox.Show("El documento Digitado no existe...");
                    return;
                }
                //if(TxtNota.Text.Trim()=="")
                //{
                //    MessageBox.Show("Digite Nota.... ");
                //    TxtNota.Focus();
                //    return;
                //}
                //if(TxtAutoriza.Text.Trim()=="")
                //{
                //    MessageBox.Show("Digite Autorizado...");
                //    TxtAutoriza.Focus();
                //    return;
                //}
                if (CBXconcepto.SelectedIndex < 0)
                {
                    MessageBox.Show("Seleccione concepto de devolucion....");
                    CBXconcepto.Focus();
                    return;
                }
                string[] ValoresReturn = new string[4];
                ValoresReturn[0] = TXfactura.Text.Trim();
                ValoresReturn[1] = TxtNota.Text.Trim();
                ValoresReturn[2] = TxtAutoriza.Text.Trim();
                ValoresReturn[3] = CBXconcepto.SelectedValue.ToString();

                if (ValoresReturn.Length > 0)
                {
                    ArrayReturn = ValoresReturn;
                }

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
예제 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //idemp = SiaWin._BusinessId;
            LoadConfig();
            pantalla();

            string    cadena = "select cod_dev,descripcion from incon_dev order by cod_dev";
            DataTable dt     = SiaWin.Func.SqlDT(cadena, "Clientes", idemp);

            CBXconcepto.ItemsSource = dt.DefaultView;
            CmbTipoDoc.Focus();
        }
예제 #4
0
        private void BTNconsultar_Click(object sender, RoutedEventArgs e)
        {
            // validaciones
            int    tipoDoc          = CmbTipoDoc.SelectedIndex;
            string FechaConsultaIni = FechaConsIni.Text.Trim();
            string FechaConsultaFin = FechaConsFin.Text.Trim();

            if (string.IsNullOrEmpty(FechaConsultaIni) || string.IsNullOrEmpty(FechaConsultaFin))
            {
                MessageBox.Show("Falta Fecha de Consulta....");
                FechaConsIni.Focus();
                return;
            }
            if (tipoDoc < 0)
            {
                MessageBox.Show("Seleccione un tipo de documento..");
                CmbTipoDoc.Focus();
                return;
            }

            if (FechaConsIni.Text != "" && FechaConsFin.Text != "")
            {
                string tipoTrn = "005";
                if (tipoDoc == 0)
                {
                    tipoTrn = "004";
                }
                ConsultaDocumentos ventana = new ConsultaDocumentos();
                ventana.fechaini = FechaConsIni.Text;
                ventana.fechafin = FechaConsFin.Text;
                ventana.codbod   = codbod;
                ventana.tipoTrn  = tipoTrn;
                ventana.idemp    = idemp;

                ventana.ShowInTaskbar = false;
                ventana.Owner         = Application.Current.MainWindow;
                ventana.ShowDialog();

                if (ventana.Documento != "")
                {
                    TXfactura.Text  = ventana.Documento;
                    TipoTransaccion = ventana.tipoTrn;
                    idregcab        = ventana.idregcab;
                }
                ventana = null;
            }
        }
예제 #5
0
        private async void Ejecutar_Click(object sender, RoutedEventArgs e)
        {
            //LoadData(codtrn);
            try
            {
                int _TipoDoc = CmbTipoDoc.SelectedIndex;
                if (_TipoDoc < 0)
                {
                    MessageBox.Show("Seleccione un Tipo de Documento..");
                    CmbTipoDoc.Focus();
                    CmbTipoDoc.IsDropDownOpen = true;
                    return;
                }

                CancellationTokenSource source = new CancellationTokenSource();
                CancellationToken       token  = source.Token;
                sfBusyIndicator.IsBusy = true;
                dataGridSF.ItemsSource = null;


                string codtrn = "005";
                if (_TipoDoc == 0)
                {
                    codtrn = "004";                 // pos
                }
                if (_TipoDoc == 1)
                {
                    codtrn = "005";                 // factura
                }
                if (_TipoDoc == 2)
                {
                    codtrn = "007";                 //anulacion factura
                }
                if (_TipoDoc == 3)
                {
                    codtrn = "008";                // devolucion aplicada
                }
                if (_TipoDoc == 4)
                {
                    codtrn = "011";                // coditazion
                }
                if (_TipoDoc == 5)
                {
                    codtrn = "505";                // pedidos
                }
                string FecIni = FechaIni.Text;
                string FecFin = FechaFin.Text;
                string bodega = codbod.Trim();

                var slowTask = Task <DataSet> .Factory.StartNew(() => SlowDude(FecIni, FecFin, bodega, codtrn, source.Token), source.Token);

                await slowTask;

                if (((DataSet)slowTask.Result).Tables[0].Rows.Count > 0)
                {
                    dataGridSF.ItemsSource = ((DataSet)slowTask.Result).Tables[0];
                    TextTotalEntradas.Text = ((DataSet)slowTask.Result).Tables[0].Rows.Count.ToString();
                }

                this.sfBusyIndicator.IsBusy = false;
            }
            catch (Exception ex)
            {
                this.Opacity = 1;
                //MessageBox.Show("aqui 2.1" + ex);
            }
        }