protected void btnEliminar_Click(object sender, EventArgs e) { try { LinkButton btn = (LinkButton)sender; DataListItem item = (DataListItem)btn.NamingContainer; Label lb = (Label)item.FindControl("lbIdPath"); int codNegoc = int.Parse(util.desencriptar(Request.Params["show"])); lgPath = new LogicaPath(); if (lgPath.EliminarPath(int.Parse(lb.Text))) { ltMsnMultimedia.Text = @"<div class='alert alert-info alert-dismissable'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a> <strong>¡Información!</strong>Imagen eliminada</div>"; CargarPath(); } else { ltMsnMultimedia.Text = @"<div class='alert alert-danger alert-dismissable'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a> <strong>Error! </strong> Imagen no elinada</div>"; } } catch (Exception ex) { ltMsnMultimedia.Text = @"<div class='alert alert-danger alert-dismissable'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a> <strong>Error! </strong> " + ex.Message + "</div>"; } }
private void CargarPath() { lgPath = new LogicaPath(); util = new csUtilidades(); lgNegocio = new LogicaPath(); dlPath.DataSource = lgNegocio.DataTbPath(int.Parse(util.desencriptar(Request.Params["show"]))); dlPath.DataBind(); }
protected void btnAgregarNegocio_Click(object sender, EventArgs e) { LogicaNegocio lgNegocio = new LogicaNegocio(); lgPath = new LogicaPath(); csUsuario usuario = (csUsuario)Session["Usuario"]; lgExtNegocio = new LogicaEstadoNegocio(); if (IsValid) { if ((uploadFile1.PostedFile != null) && (uploadFile1.PostedFile.ContentLength > 0)) { try { string fn = System.IO.Path.GetFileName(uploadFile1.PostedFile.FileName); string SaveLocation = Server.MapPath("media\\img") + "\\" + fn; csNegocio negocio = new csNegocio(0, txtNombre.Text, txtDescdrip.Text, txtTelefono.Text, usuario.id_usuario, uploadFile1.FileName, hdLonft.Value, txtUbicacion.Text, hdLatFt.Value); int codNegoc = int.Parse(lgNegocio.CrearNegocio(negocio)); if (codNegoc > 0) { uploadFile1.PostedFile.SaveAs(SaveLocation); foreach (ListItem item in chekListCategoria.Items) { if (item.Selected) { estNegocio = new csEstadoNegocio(0, int.Parse(item.Value.ToString()), codNegoc); lgExtNegocio.CrearEstadoNegocio(estNegocio); } } Button2_ModalPopupExtender.Show(); } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> no guardor el registro. </div>"; } } catch (Exception ex) { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Advertencia</strong> " + ex.Message + "</div>"; } } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> No cargo la Foto. </div>"; } } }
protected void btnAgregar_Click(object sender, EventArgs e) { LogicaNegocio lgNegocio = new LogicaNegocio(); lgPath = new LogicaPath(); csUsuario usuario = (csUsuario)Session["Usuario"]; if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0)) { try { util = new csUtilidades(); string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName); string SaveLocation = Server.MapPath("media\\img") + "\\" + fn; int codNegoc = int.Parse(util.desencriptar(Request.Params["show"])); csPath path = new csPath(0, FileUpload1.FileName, codNegoc); if (lgPath.CrearPath(path)) { FileUpload1.PostedFile.SaveAs(SaveLocation); CargarPath(); ltMsnMultimedia.Text = @"<div class='alert alert-info alert-dismissable'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a> <strong>¡Información!</strong> Imagen Agregada</div>"; } else { ltMsnMultimedia.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> no guardor el registro. </div>"; } } catch (Exception ex) { ltMsnMultimedia.Text = @"<div class='alert alert-danger'> <strong>Advertencia</strong> " + ex.Message + "</div>"; } } else { ltMsnMultimedia.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> No cargo la Foto. </div>"; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Negocio"] != null) { LogicaPath lgPath = new LogicaPath(); negocio = (csNegocio)Session["Negocio"]; Repeater1.DataSource = lgPath.DataTbPath(negocio.id_negocio);; Repeater1.DataBind(); lbNombre.Text = negocio.nombre; lbDescrip.Text = negocio.descripcion; lbTelefono.Text = negocio.telefono.ToString(); lbUbicacion.Text = negocio.ubicacion; } else { Response.Redirect("IndexPropietario.aspx"); } }
protected void btnAgregarNegocio_Click(object sender, EventArgs e) { LogicaNegocio lgNegocio = new LogicaNegocio(); lgPath = new LogicaPath(); if ((uploadFile1.PostedFile != null) && (uploadFile1.PostedFile.ContentLength > 0)) { try { string fn = System.IO.Path.GetFileName(uploadFile1.PostedFile.FileName); string SaveLocation = Server.MapPath("media\\img") + "\\" + fn; csNegocio negocio = new csNegocio(0, txtNombre.Text, txtDescdrip.Text, txtTelefono.Text, int.Parse(Request.Params["perfil"]), uploadFile1.FileName, hdLonft.Value, txtUbicacion.Text, hdLatFt.Value); int codNegoc = int.Parse(lgNegocio.CrearNegocio(negocio)); if (codNegoc > 0) { uploadFile1.PostedFile.SaveAs(SaveLocation); Button2_ModalPopupExtender.Show(); } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> no guardor el registro. </div>"; } } catch (Exception ex) { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Advertencia</strong> " + ex.Message + "</div>"; } } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> No cargo la Foto. </div>"; } }
protected void btnModificar_Click(object sender, EventArgs e) { try { if (IsValid) { LogicaNegocio lgNegocio = new LogicaNegocio(); lgPath = new LogicaPath(); csUsuario usuario = (csUsuario)Session["Usuario"]; int codNegoc = int.Parse(Request.Params["negocio"]); lgEstaNegocio = new LogicaEstadoNegocio(); if ((uploadFile1.PostedFile != null) && (uploadFile1.PostedFile.ContentLength > 0)) { string fn = System.IO.Path.GetFileName(uploadFile1.PostedFile.FileName); string SaveLocation = Server.MapPath("media/img") + "/" + fn; csNegocio negocio = new csNegocio(int.Parse(hdCodNegocio.Value), txtNombre.Text, txtDescdrip.Text, txtTelefono.Text, usuario.id_usuario, uploadFile1.FileName, hdLonft.Value, txtUbicacion.Text, hdLatFt.Value); if (lgNegocio.ModificarNegocio(negocio)) { foreach (ListItem item in chekListCategoria.Items) { if (item.Selected) { if (lgEstaNegocio.validarEstadNegocio(int.Parse(item.Value.ToString()), codNegoc) == false) { estNegocio = new csEstadoNegocio(0, int.Parse(item.Value.ToString()), codNegoc); lgEstaNegocio.CrearEstadoNegocio(estNegocio); } } if (item.Selected == false) { if (lgEstaNegocio.validarEstadNegocio(int.Parse(item.Value.ToString()), codNegoc)) { lgEstaNegocio.EliminarEstadoNegocio(int.Parse(item.Value.ToString())); } } } uploadFile1.PostedFile.SaveAs(SaveLocation); Button2_ModalPopupExtender.Show(); } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> no guardor el registro. </div>"; } } else { //string fn = System.IO.Path.GetFileName(uploadFile1.PostedFile.FileName); //string SaveLocation = Server.MapPath("media/img") + "/" + fn; csNegocio negocio = new csNegocio(int.Parse(hdCodNegocio.Value), txtNombre.Text, txtDescdrip.Text, txtTelefono.Text, usuario.id_usuario, "", hdLonft.Value, txtUbicacion.Text, hdLatFt.Value); if (lgNegocio.ModificarNegocio2(negocio)) { foreach (ListItem item in chekListCategoria.Items) { if (item.Selected) { if (lgEstaNegocio.validarEstadNegocio(int.Parse(item.Value.ToString()), codNegoc) == false) { estNegocio = new csEstadoNegocio(0, int.Parse(item.Value.ToString()), codNegoc); lgEstaNegocio.CrearEstadoNegocio(estNegocio); } } if (item.Selected == false) { if (lgEstaNegocio.validarEstadNegocio(int.Parse(item.Value.ToString()), codNegoc)) { lgEstaNegocio.EliminarEstadoNegocio(int.Parse(item.Value.ToString())); } } } //uploadFile1.PostedFile.SaveAs(SaveLocation); Button2_ModalPopupExtender.Show(); } else { ltRepuesta.Text = @"<div class='alert alert-danger'> <strong>Danger!</strong> no guardor el registro. </div>"; } } } } catch (Exception ex) { ltRepuesta.Text = @"<div class='alert alert-danger alert-dismissable'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a> <strong>Error! </strong> " + ex.Message + "</div>"; } }
//private void CargarChart() //{ // csUtilidades util = new csUtilidades(); // lgVisita = new LogicaVisita(); // int codNegocio = int.Parse(util.desencriptar(Request.Params["show"])); // Chart1.DataSource = lgVisita.LineaTeiempoVisita(codNegocio); // //Chart1.Series["Series1"].Points.DataBindXY("numero", "Tiempo"); // Chart1.Series["Series1"].XValueMember = "numero"; // Chart1.Series["Series1"].YValueMembers = "Tiempo"; // Chart1.DataBind(); //} private void CargarGaleria(int cod) { lgPaht = new LogicaPath(); rpGaleria.DataSource = lgPaht.DataTbPath(cod); rpGaleria.DataBind(); }