Exemplo n.º 1
0
 public void agregarImagenes(ImagenesBEL imaBel)
 {
     try
     {
         fru.WebServicePruebaSoapClient servicio = new fru.WebServicePruebaSoapClient();
         servicio.Imagenes_Ins(imaBel.Id_producto, imaBel.Nombre, imaBel.Descripcion, imaBel.Orden, imaBel.Fecha, imaBel.Ubicacion);
     }
     catch
     {
         return;
     }
 }
Exemplo n.º 2
0
        public List <ImagenesBEL> Imagenes_Sel_All()
        {
            fru.WebServicePruebaSoapClient servicio = new fru.WebServicePruebaSoapClient();
            DataSet ds = servicio.Imagenes_Sel_All();

            List <ImagenesBEL> list = new List <ImagenesBEL>();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                ImagenesBEL obj = new ImagenesBEL();
                obj.Id_producto = Convert.ToInt32(r["id_producto"]);
                obj.Nombre      = r["nombre"].ToString();
                obj.Descripcion = r["descripcion"].ToString();
                obj.Orden       = Convert.ToInt32(r["orden"]);
                obj.Fecha       = Convert.ToDateTime(r["fecha"]);
                obj.Ubicacion   = r["ubicacion"].ToString();
                list.Add(obj);
            }
            return(list);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Guarda o Modifica el Evento con los datos ingresados por el usuario
        /// </summary>
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String     strFileName, strFileSave;
            UsuarioBEL usuario = (UsuarioBEL)Session["usuarioConectado"];
            int        rut     = usuario.Rut;

            ProductorBEL proBEL = new ProductorBEL();
            ProductorBLL proBLL = new ProductorBLL();

            proBEL = proBLL.Productor_Sel(rut);

            ProductosBEL proBel = new ProductosBEL();

            proBel.Rut_productor    = proBEL.Rut;
            proBel.Id_tipo_producto = Int32.Parse(ddlTipo.SelectedItem.Value);
            if (chkOferta.Checked)
            {
                proBel.Oferta = 1;
            }
            else
            {
                proBel.Oferta = 0;
            }
            proBel.Descripcion_elaboracion = txtDescripcion.Text;
            proBel.Id_direccion            = proBEL.Id_direccionnegocio;
            proBel.Zona_cultivo            = txtZona.Text;
            proBel.Stock           = Convert.ToInt32(txtStock.Text);
            proBel.Precio_unitario = Convert.ToInt32(txtPrecio.Text);
            proBel.Id_medida       = Int32.Parse(ddlMedida.SelectedItem.Value);
            proBel.Id_tipo_cultivo = Int32.Parse(ddlCultivo.SelectedItem.Value);
            proBel.Activo          = 1;

            ProductosBLL proBll = new ProductosBLL();
            int          id     = proBll.agregarProductos(proBel);

            if (validaImagen(subirImagen.PostedFile.FileName))
            {
                strFileName = System.IO.Path.GetFileName(subirImagen.PostedFile.FileName);
                String strFolderSave = Server.MapPath("../img/Productos/");
                strFileSave = "/img/Productos/" + strFileName;

                ImagenesBEL imaBEL = new ImagenesBEL();
                imaBEL.Id_producto = id;
                imaBEL.Nombre      = txtNombre.Text;
                imaBEL.Descripcion = txtDescripcionI.Text;
                imaBEL.Orden       = Convert.ToInt32(txtOrden.Text);
                imaBEL.Fecha       = DateTime.Today;
                imaBEL.Ubicacion   = strFileSave;
                subirImagen.PostedFile.SaveAs(strFolderSave + strFileName);

                ImagenesBLL imaBLL = new ImagenesBLL();
                imaBLL.agregarImagenes(imaBEL);
            }

            /// <summary>
            /// Agrega el evento
            /// </summary>
            EventoBLL evBLL = new EventoBLL();

            if (lblTitulo.Text.Equals("Agregar evento"))
            {
                // int idEvento = evBLL.agregarEvento(evBEL);
                //if (idEvento == -1) return;

                /*** se Agregan Los Asientos ***/
                // this.guardarAsiento(idEvento);
                /***** Fin Agrega Asientos ******/

                /*** se Agregan Los Precios ***/
                // this.guardarPrecio(idEvento);
                /***** Fin Agrega Precios ******/
                Response.Write("<script>alert('Se agregó correctamente');window.location='Eventos.aspx';</script></script>");
            }
            /// <summary>
            /// Modifica el evento
            /// </summary>
            else
            {
                // evBEL.IdEvento = Int32.Parse(idEvento.Text);
                //evBLL.actualizarEvento(evBEL);
                Response.Write("<script>alert('Se Editó correctamente');window.location='Eventos.aspx';</script></script>");
            }
        }