Exemplo n.º 1
0
        public DateTime validar10002()
        {
            BlumarWS.rfcNetSoapClient cliente = new BlumarWS.rfcNetSoapClient();

            BlumarWS.ZMOV_10002_IR_CHARG[] lotes = new BlumarWS.ZMOV_10002_IR_CHARG[1];

            lotes[0]        = new BlumarWS.ZMOV_10002_IR_CHARG();
            lotes[0].SIGN   = "I";
            lotes[0].OPTION = "EQ";
            lotes[0].LOW    = txtLote.Text;

            BlumarWS.request_ZMOV_10002 imp2 = new BlumarWS.request_ZMOV_10002();

            imp2.IV_SPRAS = "ES";
            imp2.IV_PROC  = "01";
            imp2.IV_MATNR = cbxMaterial.SelectedValue.ToString();
            imp2.IR_CHARG = lotes;

            BlumarWS.responce_ZMOV_10002 respuesta2 = new BlumarWS.responce_ZMOV_10002();

            DateTime fechaCreacion = DateTime.Now;

            try
            {
                respuesta2 = cliente.ZMOV_10002(imp2);
            }
            catch (Exception e)
            {
                MessageBox.Show("" + e);
            }

            try
            {
                try
                {
                    fechaCreacion = DateTime.Parse(respuesta2.LT_DATOS_LOTES[0].FABRICACION);
                    return(fechaCreacion);
                }
                catch (Exception e)
                {
                    MessageBox.Show("No se encuentra la fecha de creacion del Lote " + e);
                    return(fechaCreacion);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(" No se encuentra la fecha de creacion ----- " + e);
                return(fechaCreacion);
            }
        }
Exemplo n.º 2
0
        //DateTime fechaCreacion = DateTime.Parse("02/04/2019 12:00:00 AM");
        public Boolean llenarCampos()
        {
            BlumarWS.rfcNetSoapClient cliente = new BlumarWS.rfcNetSoapClient();

            BlumarWS.request_ZMOV_10000 imp = new BlumarWS.request_ZMOV_10000();

            imp.CHARG = txtLote.Text;
            imp.MATNR = cbxMaterial.SelectedValue.ToString();

            BlumarWS.responce_ZMOV_10000   respuesta = new BlumarWS.responce_ZMOV_10000();
            BlumarWS.ZMOV_10002_IR_CHARG[] lotes     = new BlumarWS.ZMOV_10002_IR_CHARG[1];

            lotes[0]        = new BlumarWS.ZMOV_10002_IR_CHARG();
            lotes[0].SIGN   = "I";
            lotes[0].OPTION = "EQ";
            lotes[0].LOW    = txtLote.Text;

            BlumarWS.request_ZMOV_10002 imp2 = new BlumarWS.request_ZMOV_10002();

            imp2.IV_SPRAS = "ES";
            imp2.IV_PROC  = "01";
            imp2.IV_MATNR = cbxMaterial.SelectedValue.ToString();
            imp2.IR_CHARG = lotes;

            BlumarWS.responce_ZMOV_10002 respuesta2 = new BlumarWS.responce_ZMOV_10002();

            try
            {
                respuesta = cliente.ZMOV_10000(imp);
            }
            catch (Exception e)
            {
                MessageBox.Show("" + e);
            }


            try
            {
                /*
                 * try
                 * {
                 *  var rechazito = Array.FindIndex(respuesta.CHAR_OF_BATCH, row => row.ATNAM == "ZRECHAZO");
                 *  lblRechazo.Content = respuesta.CHAR_OF_BATCH[rechazito].ATWTB;
                 * }
                 * catch (Exception)
                 * {
                 *  lblRechazo.Content = "";
                 * }
                 */

                try
                {
                    var envase = Array.FindIndex(respuesta.CHAR_OF_BATCH, row => row.ATNAM == "ZTIPHU");
                    //MessageBox.Show(respuesta.CHAR_OF_BATCH[envase].ATWTB);

                    cbxEnvase.Text = respuesta.CHAR_OF_BATCH[envase].ATWTB;
                }
                catch (Exception)
                {
                    if (respuesta.CHAR_OF_BATCH.Length == 0)
                    {
                        MessageBox.Show("Lote no existe");
                        cbxMaterial.SelectedValue = 0;
                    }
                    else
                    {
                        //MessageBox.Show("Lote no contiene envase seleccionado");
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                MessageBox.Show("No se encuentra el Lote");
                cbxMaterial.SelectedValue = 0;
                return(false);
            }
        }