Exemple #1
0
 private void btn_EstibaBuscar_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(cmb_temporada.EditValue.ToString()) && txtManifiesto.Text != string.Empty)
     {
         CLS_Estiba sel = new CLS_Estiba();
         sel.c_codigo_tem = cmb_temporada.EditValue.ToString();
         sel.c_codigo_man = txtManifiesto.Text;
         sel.MtdSeleccionarSICFIManifiesto();
         if (sel.Exito)
         {
             if (sel.Datos.Rows.Count > 0)
             {
                 dtgManifiesto.DataSource = sel.Datos;
                 dtgValManifiesto.BestFitColumns();
             }
             else
             {
                 XtraMessageBox.Show("No se encontraron datos de este manifiesto");
             }
         }
         else
         {
             XtraMessageBox.Show(sel.Mensaje);
         }
     }
 }
        private void CargarEstibas()
        {
            CLS_Estiba sel = new CLS_Estiba();

            sel.c_codigo_tem = vc_codigo_tem;
            sel.MtdSeleccionarEstiba();
            if (sel.Exito)
            {
                if (sel.Datos.Rows.Count > 0)
                {
                    dtgEstibas.DataSource = sel.Datos;
                }
            }
        }
Exemple #3
0
        private string CalcularFecha()
        {
            string     vfecha = string.Empty;
            CLS_Estiba sel    = new CLS_Estiba();

            sel.c_codigo_tem = cmb_temporada.EditValue.ToString();
            sel.c_codigo_man = txtManifiesto.Text;
            sel.MtdSeleccionarSICFIManifiestoFecha();
            if (sel.Exito)
            {
                if (sel.Datos.Rows.Count > 0)
                {
                    DateTime Fecha1 = Convert.ToDateTime(sel.Datos.Rows[0]["fechaini"].ToString());
                    DateTime Fecha2 = Convert.ToDateTime(sel.Datos.Rows[0]["fechafin"].ToString());
                    string   Cadena = DosCero(Fecha1.Day.ToString()) + DosCero(Fecha1.Month.ToString()) + Fecha1.Year.ToString() + DosCero(Fecha2.Day.ToString()) + DosCero(Fecha2.Month.ToString()) + Fecha2.Year.ToString();
                    vfecha = Cadena;
                }
            }
            return(vfecha);
        }
Exemple #4
0
        private void btn_Generar_Click(object sender, EventArgs e)
        {
            DialogResult result = DialogoFolder.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (dtgValManifiesto.RowCount > 0 && txtManifiesto.Text != string.Empty)
                {
                    string       NombreArchivo = cmb_temporada.EditValue + "-" + txtManifiesto.Text;
                    string       Ruta          = DialogoFolder.SelectedPath.ToString() + "\\" + NombreArchivo + ".txt";
                    StreamWriter sw            = new StreamWriter(Ruta);
                    if (!string.IsNullOrEmpty(cmb_temporada.EditValue.ToString()) && txtManifiesto.Text != string.Empty)
                    {
                        CLS_Estiba sel = new CLS_Estiba();
                        sel.c_codigo_tem = cmb_temporada.EditValue.ToString();
                        sel.c_codigo_man = txtManifiesto.Text;
                        sel.MtdSeleccionarSICFIManifiesto();
                        if (sel.Exito)
                        {
                            if (sel.Datos.Rows.Count > 0)
                            {
                                fecha = CalcularFecha();
                                sw.WriteLine(fecha);
                                string vPaletTemp = string.Empty;
                                string vPalet     = string.Empty;
                                for (int i = 0; i < sel.Datos.Rows.Count; i++)
                                {
                                    if (vPaletTemp == sel.Datos.Rows[i]["Palet"].ToString())
                                    {
                                        vPalet += Espacios(sel.Datos.Rows[i]["n_bulxpa_pal"].ToString(), 10);
                                        vPalet += Espacios(sel.Datos.Rows[i]["id_product"].ToString(), 5);
                                        vPalet += Espacios(sel.Datos.Rows[i]["id_size"].ToString(), 3);
                                        vPalet += Espacios(sel.Datos.Rows[i]["v_registro_hue"].ToString(), 14);
                                        vPalet += Espacios(sel.Datos.Rows[i]["c_codigo_lot"].ToString(), 10);
                                    }
                                    else
                                    {
                                        if (i != 0)
                                        {
                                            sw.WriteLine(vPalet);
                                        }
                                        vPalet     = sel.Datos.Rows[i]["Palet"].ToString();
                                        vPaletTemp = vPalet;
                                        vPalet    += sel.Datos.Rows[i]["id_commodity"].ToString();
                                        vPalet    += sel.Datos.Rows[i]["c_codigo_tra"].ToString();
                                        vPalet    += sel.Datos.Rows[i]["v_codext_tif"].ToString();

                                        vPalet += Espacios(sel.Datos.Rows[i]["n_bulxpa_pal"].ToString(), 10);
                                        vPalet += Espacios(sel.Datos.Rows[i]["id_product"].ToString(), 5);
                                        vPalet += Espacios(sel.Datos.Rows[i]["id_size"].ToString(), 3);
                                        vPalet += Espacios(sel.Datos.Rows[i]["v_registro_hue"].ToString(), 14);
                                        vPalet += Espacios(sel.Datos.Rows[i]["c_codigo_lot"].ToString(), 10);
                                    }
                                }
                                sw.WriteLine(vPalet);
                                sw.Close();
                                XtraMessageBox.Show("Se ha generado el archivo con exito");
                                StartProcess(DialogoFolder.SelectedPath.ToString());
                            }
                        }
                    }
                }
            }
        }