Пример #1
0
        private void BtnDetalleInv_Click(object sender, EventArgs e)
        {
            N_Detalle_Inventario          DI  = new N_Detalle_Inventario();
            N_Imagenes_Detalle_Inventario IDI = new N_Imagenes_Detalle_Inventario();

            //DI.Cadena(Program.GsPathData);
            //IDI.Cadena(Program.GsPathData);


            DataTable Tabla = DI.Consultar();
            string    NombreImagenDI;
            string    DirectorioDestino = "";
            string    NombreArchivo     = "";
            string    DirectorioOrigen  = "";

            PBar.Minimum = 1;
            PBar.Maximum = Tabla.Rows.Count - 1;
            foreach (DataRow Fila in Tabla.Rows)
            {
                //PBar.Value++;
                Application.DoEvents();
                DirectorioDestino = @"Fotos\fotos_inm\inm_" + Fila["Cod_inmueble"];
                NombreImagenDI    = Fila["Nombre_imagen"].ToString();
                if (NombreImagenDI != "")
                {
                    ExtraerDatos(NombreImagenDI, ref NombreArchivo, ref DirectorioOrigen);
                }
                DGVDetalle.Rows.Add(NombreArchivo, DirectorioOrigen, DirectorioDestino);
                DirectorioOrigen.Replace("/", @"\");
                DirectorioDestino.Replace("/", @"\");
                CrearDirectorio(DirectorioDestino);
                GrabarArchivo(NombreArchivo, DirectorioOrigen, DirectorioDestino);
                //Pasar las imagenes del detalle
                DataTable DTImagenes = IDI.ImagenesInmueble(Convert.ToInt32(Fila["Cod_inmueble"]));
                foreach (DataRow Item in DTImagenes.Rows)
                {
                    NombreImagenDI = Item["Nombre_imagen"].ToString();
                    if (NombreImagenDI != "")
                    {
                        ExtraerDatos(NombreImagenDI, ref NombreArchivo, ref DirectorioOrigen);
                    }
                    DGVDetalle.Rows.Add(NombreArchivo, DirectorioOrigen, DirectorioDestino);
                    GrabarArchivo(NombreArchivo, DirectorioOrigen, DirectorioDestino);
                }
            }
            MessageBox.Show("Terminó el proceso");
        }
Пример #2
0
        private void GrabarDetalleInventario(int Cod_inmueble)
        {
            //int I;
            N_Detalle_Inventario          DetalleInventarioWeb = new N_Detalle_Inventario();
            N_Detalle_Inventario          DetalleInventario    = new N_Detalle_Inventario();
            N_Imagenes_Detalle_Inventario ImagenesWEB          = new N_Imagenes_Detalle_Inventario();
            N_Imagenes_Detalle_Inventario Imagenes             = new N_Imagenes_Detalle_Inventario();
            //DetalleInventario.Cadena(Program.GsPathData, Program.gsServidor);
            //DetalleInventario.DatosServidoryPath(Application.StartupPath);
            //Imagenes.Cadena(Program.GsPathData, Program.gsServidor);
            //Imagenes.DatosServidoryPath(Application.StartupPath);
            //DetalleInventarioWeb.ConectarA("MariaDB");
            //DetalleInventarioWeb.DatosServidoryPath(Application.StartupPath);
            //ImagenesWEB.ConectarA("MariaDB");
            //ImagenesWEB.DatosServidoryPath(Application.StartupPath);
            DataTable DTInventario = new DataTable();
            DataTable DTImagenes   = new DataTable();

            DTInventario = DetalleInventario.Consultar(Cod_inmueble);
            DTImagenes   = Imagenes.Consultar(Cod_inmueble);
            DetalleInventarioWeb.GrabarDatosGrid(DTInventario);
            ImagenesWEB.GrabarDatosGrid(DTImagenes);
        }