protected void BT_Enviar_Click1(object sender, EventArgs e) { UUser dato = new UUser(); LUser contacto = new LUser(); L_Persistencia logica = new L_Persistencia(); UContacto menu = new UContacto(); menu.Nombre = TB_Nombre.Text.ToString(); menu.Telefono = TB_Telefono.Text.ToString(); menu.Email = TB_Email.Text.ToString(); menu.Detalle = TB_Detalle.Text.ToString(); menu = logica.insertarcontacto(menu); ClientScriptManager cm = this.ClientScript; //dato = contacto.contactenos(TB_Nombre.Text, TB_Telefono.Text, TB_Email.Text, TB_Detalle.Text); String mens = Session["men"].ToString(); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + mens.ToString() + "');window.location=\"Inicio.aspx\"</script>"); DataTable regis = contacto.ToDataTable(contacto.obtenerAcontacto()); String esquema = "usuario"; String tabla = "contacto"; String pk = "1"; String session = Session.SessionID; contacto.insert(regis, esquema, tabla, pk, session); //this.Page.Response.Write(mens); }
protected void TB_Filtro_TextChanged(object sender, EventArgs e) { LUser dato = new LUser(); L_Persistencia data = new L_Persistencia(); UUsuario datos = new UUsuario(); ClientScriptManager cm = this.ClientScript; DataTable usuario; String nombre = TB_Filtro.Text.ToString(); try { DataTable validez = data.ToDataTable(data.buscarCliente(nombre)); datos.X = int.Parse(validez.Rows[0]["user_id"].ToString()); GV_listClien.DataSource = data.buscarCliente(nombre); GV_listClien.DataBind(); } catch { } //usuario = data.buscarCliente(datos); //GV_listClien.DataSource = usuario; //GV_listClien.DataBind(); //this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('Empleado no Existe');window.location=\"ListaEmpleados.aspx\"</script>"); }
protected void B_guardar_Click(object sender, EventArgs e) { UuserReservas dato = new UuserReservas(); UPreserva datos = new UPreserva(); LUser doc = new LUser(); L_Persistencia dac = new L_Persistencia(); ClientScriptManager cm = this.ClientScript; string nombre = Session["usuario"].ToString(); System.Data.DataTable validez1 = doc.obteberidres(nombre); //duda aca con doc Int32 id_reserva = int.Parse(validez1.Rows[0]["id_reserva"].ToString()); Button btn = (Button)sender; DataListItem item = (DataListItem)btn.NamingContainer; TextBox guardar = (TextBox)item.FindControl("TB_insertarPedido"); datos.Cantidad = int.Parse(guardar.Text); Label lblid = (Label)item.FindControl("LB_idPlatos"); datos.Id_plato = int.Parse(lblid.Text); datos.Id_reserva = id_reserva; datos.Fecha_ingreso = DateTime.Now; //datos.Fecha_despacho = DateTime.Parse(null); dac.insertarPlatoR(datos); // doc.insertarplares(dato); String mens = Session["men"].ToString(); cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('" + mens.ToString() + "');</script>"); }
protected void Eliminar_Click(object sender, EventArgs e) { UIdioma datos = new UIdioma(); L_Persistencia user = new L_Persistencia(); UAidioma idioma = new UAidioma(); LUser data = new LUser(); //LIdioma user = new LIdioma(); ClientScriptManager cm = this.ClientScript; try { idioma.Id = int.Parse(Session["idioma"].ToString()); idioma.Nombre = Session["nombre"].ToString(); idioma.Terminacion = Session["terminacion"].ToString(); datos.Mensaje = Session["men1"].ToString(); datos.B = Session["men2"].ToString(); String nombre = idioma.Nombre; DataTable regis = data.ToDataTable(data.obtenerIdiomac(nombre)); String esquema = "idioma"; String tabla = "idioma"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; data.delete(regis, esquema, tabla, pk, session); datos = user.eliminarIdioma(idioma, datos); this.RegisterStartupScript("mensaje", datos.Mensaje); } catch { Session["ddl"] = 1; } }
protected void B_guardar_Click(object sender, EventArgs e) { UuserCrear datos = new UuserCrear(); LMenu ins = new LMenu(); UUser info = new UUser(); L_Persistencia logica = new L_Persistencia(); Menu menu = new Menu(); LUser user = new LUser(); menu.Nombre = TB_nompla.Text.ToString(); menu.Descripcion = TB_desc.Text.ToString(); menu.Precio = TB_precio.Text.ToString(); info.Ruta = (FU_imagen.PostedFile.FileName); menu.Imagen = cargarImagen(); datos = logica.insertarmenu(menu); DataTable regis = user.ToDataTable(user.obtenerAMenu()); String esquema = "usuario"; String tabla = "menu"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; user.insert(regis, esquema, tabla, pk, session); }
protected void BT_Modificar_Click(object sender, EventArgs e) { UUser datos = new UUser(); LUser user = new LUser(); ClientScriptManager cm = this.ClientScript; L_Persistencia logica = new L_Persistencia(); Mesas mesas = new Mesas(); mesas.Id_mesas = int.Parse(Session["id_mesa"].ToString()); mesas.Cantidad = int.Parse(TB_Cantidad.Text.ToString()); mesas.Ubicacion = TB_Ubicacion.Text.ToString(); Int32 nombre = mesas.Id_mesas; DataTable regis = user.ToDataTable(user.obtenerMes(nombre)); String esquema = "usuario"; String tabla = "mesas"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; datos = logica.actualizarMesas(mesas); user.updateMesas(regis, mesas, esquema, tabla, pk, session); //logica.actualizarMesas(mesas); //user.mofifimesas(datos); String mens = Session["men"].ToString(); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + mens.ToString() + "');window.location=\"ListarMesas.aspx\"</script>"); }
protected void B_guardar_Click(object sender, EventArgs e) { UuserPedido dato = new UuserPedido(); UPedidoplato datos = new UPedidoplato(); //UuserPedido pe = new UuserPedido(); ClientScriptManager cm = this.ClientScript; LUser doc = new LUser(); L_Persistencia dac = new L_Persistencia(); dato.Id_usuario = int.Parse(Session["user_id"].ToString()); //DataTable validez1 = doc.obtenerpe(dato.Id_usuario); //DataTable validez1 = dac.obtenPedido(dato.Id_usuario); DataTable validez1 = dac.ToDataTable(dac.obtenPedido(dato)); datos.Id_pedido = int.Parse(validez1.Rows[0]["id_pedido"].ToString()); datos.Fecha_ingreso = DateTime.Now; Button btn = (Button)sender; DataListItem item = (DataListItem)btn.NamingContainer; TextBox guardar = (TextBox)item.FindControl("TB_insertarPedido"); datos.Cantidad = int.Parse(guardar.Text); Label lblid = (Label)item.FindControl("LB_Codigop"); datos.Id_plato = int.Parse(lblid.Text); dac.insertarPedido(datos); //doc.guardarPedido(dato); String mens = Session["men"].ToString(); cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('" + mens.ToString() + "');</script>"); }
protected void BT_Eliminar_Click(object sender, EventArgs e) { UuserCrear datos = new UuserCrear(); LUser dato = new LUser(); ClientScriptManager cm = this.ClientScript; L_Persistencia logica = new L_Persistencia(); Utilitarios.Menu menu = new Utilitarios.Menu(); String nombre = Session["nombrep"].ToString(); DataTable validez1 = dato.obtenerMesa(nombre); Int32 User_id = int.Parse(validez1.Rows[0]["id_plato"].ToString()); menu.Id_plato = User_id; menu.Nombre = validez1.Rows[0]["nombre"].ToString(); menu.Descripcion = validez1.Rows[0]["descripcion"].ToString(); menu.Precio = validez1.Rows[0]["precio"].ToString(); menu.Imagen = validez1.Rows[0]["imagen"].ToString(); //dato.eliminarPlato(datos); DataTable regis = dato.ToDataTable(dato.obtenerMen(nombre)); String esquema = "usuario"; String tabla = "platos"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; dato.delete(regis, esquema, tabla, pk, session); datos = logica.BorrarMenu(menu); String mens = Session["men"].ToString(); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + mens.ToString() + "');window.location=\"ListadePlatos.aspx\"</script>"); }
protected void TB_Filtro_TextChanged(object sender, EventArgs e) { LUser dato = new LUser(); Mesas datos = new Mesas(); L_Persistencia data = new L_Persistencia(); UUser user = new UUser(); DataTable usuario; //String nombre = TB_Filtrar.Text.ToString(); //datos.Nombre = nombre; //DataTable validez = dato.buscarcomen(datos.Nombre); //datos.X = int.Parse(validez.Rows[0]["id_comentarios"].ToString()); //GV_Listar.DataSource = dato.buscarcomen(TB_Filtrar.Text.ToString()); //GV_Listar.DataBind(); String nombre = TB_Filtro.Text.ToString(); try { DataTable validez = data.ToDataTable(data.buscarMesa(nombre)); user.X = int.Parse(validez.Rows[0]["user_id"].ToString()); GV_Mesas.DataSource = data.buscarMesa(nombre); GV_Mesas.DataBind(); } catch { } }
public UUser Contactenos(String nombre, String email, String telefono, String detalle) { try { if (SoapHeader == null) { throw new Exception("Requiere validacion"); } if (!SoapHeader.blCredencialesValidas(SoapHeader)) { throw new Exception("Requiere validacion"); } UUser dato = new UUser(); UContacto datos = new UContacto(); L_Persistencia data = new L_Persistencia(); datos.Nombre = nombre; datos.Email = email; datos.Telefono = telefono; datos.Detalle = detalle; data.insertarcontacto(datos); return(dato); } catch (Exception ex) { throw ex; } }
public String Filtro(String nombre) { try { if (SoapHeader == null) { throw new Exception("Requiere validacion"); } if (!SoapHeader.blCredencialesValidas(SoapHeader)) { throw new Exception("Requiere validacion"); } L_Persistencia dato = new L_Persistencia(); UUser datos = new UUser(); Menu m = new Menu(); ClientScriptManager cm = this.ClientScript; DataTable data = dato.ToDataTable(dato.buscarPlatos(nombre)); DataTable d = new DataTable(); d.Columns.Add("id"); d.Columns.Add("nombre"); d.Columns.Add("descripcion"); d.Columns.Add("precio"); d.Columns.Add("imagen"); d.AcceptChanges(); int i = 0; foreach (DataRow dat in data.Rows) { m.Id_plato = int.Parse(data.Rows[i]["id_plato"].ToString()); m.Nombre = data.Rows[i]["nombre"].ToString(); m.Descripcion = data.Rows[i]["descripcion"].ToString(); m.Precio = data.Rows[i]["precio"].ToString(); String img = data.Rows[i]["imagen"].ToString(); //m.Id_plato = int.Parse(data.Rows[1]["id_plato"].ToString()); //m.Nombre = data.Rows[1]["nombre"].ToString(); //m.Descripcion = data.Rows[1]["descripcion"].ToString(); //m.Precio = data.Rows[1]["precio"].ToString(); //String img = data.Rows[1]["imagen"].ToString(); String a = img.Replace("~", ""); //Image _imagen = Image.FromFile(HttpContext.Current.Server.MapPath(img)); //byte[] _bytes = ImgToByteArray(_imagen); //String _strBase64 = Convert.ToBase64String(_bytes); m.Imagen = "http://localhost:53180" + a; d.Rows.Add(m.Id_plato, m.Nombre, m.Descripcion, m.Precio, m.Imagen); i++; } String datas = JsonConvert.SerializeObject(d); return(datas); } catch (Exception ex) { throw ex; } }
protected void BT_Mesa_Click(object sender, EventArgs e) { Uubicacion dato = new Uubicacion(); ClientScriptManager cm = this.ClientScript; LUser doc = new LUser(); L_Persistencia dac = new L_Persistencia(); dato.Id_mesa = int.Parse(DDL_Ubicacion.SelectedValue.ToString()); dato.Id_usuario = int.Parse(Session["user_id"].ToString()); dac.guardarUbicacion(dato); }
protected void BT_Enviar_Click1(object sender, EventArgs e) { try { // SRContactenos es el nombre q el cliente le da al servicio SRContactenos.WSContactenosSoapClient obwsClienteSoap = new SRContactenos.WSContactenosSoapClient(); SRContactenos.clsSeguridadContactenos obclsSeguridad = new SRContactenos.clsSeguridadContactenos() { stToken = "contactenos" /// es la llave con la que se conecta al servicio, no tocar ya q no serviria el servivio //stToken = "hola" }; string stToken = obwsClienteSoap.AutenticacionUsuario(obclsSeguridad); if (stToken.Equals("-1")) { throw new Exception("Requiere Validacion"); } obclsSeguridad.AutenticacionToken = stToken; // ESOS SON LAS COSAS QUE PIDE EL SERVICIO, 5 TEXTBOX, DEJAR obclsSeguridad YA QUE ES LA SEGURIDAD DEL TOKEN obwsClienteSoap.contactenos(obclsSeguridad, TB_Nombre.Text, TB_apellido.Text, TB_Email.Text, TB_Telefono.Text, TB_Detalle.Text); UUser dato = new UUser(); LUser contacto = new LUser(); L_Persistencia logica = new L_Persistencia(); UContacto menu = new UContacto(); menu.Nombre = TB_Nombre.Text.ToString(); menu.Telefono = TB_Telefono.Text.ToString(); menu.Email = TB_Email.Text.ToString(); menu.Detalle = TB_Detalle.Text.ToString(); menu = logica.insertarcontacto(menu); ClientScriptManager cm = this.ClientScript; //dato = contacto.contactenos(TB_Nombre.Text, TB_Telefono.Text, TB_Email.Text, TB_Detalle.Text); //String mens = Session["men"].ToString(); //this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + mens.ToString() + "');window.location=\"Inicio.aspx\"</script>"); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('mensaje enviado correctamente');window.location=\"Inicio.aspx\"</script>"); //DataTable regis = contacto.ToDataTable(contacto.obtenerAcontacto()); //String esquema = "usuario"; //String tabla = "contacto"; //String pk = "1"; //String session = Session.SessionID; //contacto.insert(regis, esquema, tabla, pk, session); } catch (Exception ex) { Response.Write("<Script Languaje='JavaScript'>parent.alert('" + ex.Message + "');</Script>"); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Cache.SetNoStore(); Int32 FORMULARIO = 10; LIdioma idioma = new LIdioma(); UIdioma com = new UIdioma(); try { int DDL = int.Parse(Session["ddl"].ToString()); com = idioma.idiomaListaplatos(FORMULARIO, DDL); } catch { int DDL = 1; com = idioma.idiomaListaplatos(FORMULARIO, DDL); } Hashtable compIdioma = new Hashtable(); Session["mensajes"] = compIdioma; //for (int i = 0; i < info.Rows.Count; i++) //{ // compIdioma.Add(info.Rows[i]["control"].ToString(), info.Rows[i]["valor"].ToString()); //} LB_listPlato.Text = com.A; BT_Nuevo.Text = com.B; B_modificar.Text = com.C; BT_Eliminar.Text = com.D; LB_buscar.Text = com.E; BT_Buscar.Text = com.F; RFV_alerta.Text = com.G; validator_username.Text = com.H; GV_Platos.Columns[0].HeaderText = com.I; GV_Platos.Columns[2].HeaderText = com.J; GV_Platos.Columns[3].HeaderText = com.K; GV_Platos.Columns[4].HeaderText = com.L; GV_Platos.Columns[5].HeaderText = com.M; Session["men"] = com.N; Session["buscarp"] = com.O; L_Persistencia dato = new L_Persistencia(); GV_Platos.DataSource = dato.obtenerMenu(); GV_Platos.DataBind(); }
protected void BT_Enviar_Click(object sender, EventArgs e) { UComentarios datos = new UComentarios(); L_Persistencia user = new L_Persistencia(); UUsuario mensaje = new UUsuario(); datos.Descripcion = TB_Comentario.Text.ToString(); datos.User_id = int.Parse(Session["user_id"].ToString()); mensaje.Mensaje = Session["men"].ToString(); mensaje = user.insertarcomentario(datos, mensaje); this.Page.Response.Write(mensaje.Mensaje); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Cache.SetNoStore(); Int32 FORMULARIO = 1; LIdioma idioma = new LIdioma(); UIdioma com = new UIdioma(); Int32 DDL; try { DDL = int.Parse(Session["ddl"].ToString()); } catch { DDL = 1; } DataTable info = idioma.obtenerControl(FORMULARIO, DDL); Hashtable compIdioma = new Hashtable(); Session["mensajes"] = compIdioma; compIdioma = idioma.hastableIdioma(info, compIdioma); L_PuntosR.Text = compIdioma["L_PuntosR"].ToString(); L_cantPuntos.Text = compIdioma["L_cantPuntos"].ToString(); L_puntosInsu.Text = compIdioma["L_puntosInsu"].ToString(); L_Historial.Text = compIdioma["L_Historial"].ToString(); BT_Regresar.Text = compIdioma["BT_Regresar"].ToString(); GV_Historial.Columns[0].HeaderText = compIdioma["LB_Mesa"].ToString(); GV_Historial.Columns[1].HeaderText = compIdioma["LB_Dia"].ToString(); DL_canje.DataBind(); Session["men"] = compIdioma["JS_canje"].ToString(); int Id = int.Parse(Session["user_id"].ToString()); LUser dao = new LUser(); DataTable tabla = new DataTable(); L_Persistencia data = new L_Persistencia(); int id_usuario = int.Parse(Session["user_id"].ToString()); GV_Historial.DataSource = data.listadeReservas(id_usuario); GV_Historial.DataBind(); DataTable inter = data.ToDataTable(data.listadePuntos(Id)); //tabla = data.listadePuntos(Id); UuserReservas dato = dao.canje(inter); LB_puntos.Text = inter.Rows[0]["puntos"].ToString(); L_puntosInsu.Visible = dato.Est1; DL_canje.Visible = dato.Est2; }
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e) { ClientScriptManager cm = this.ClientScript; UDespachos datos = new UDespachos(); UPreserva reserva = new UPreserva(); L_Persistencia user = new L_Persistencia(); Session["pedido"] = GV_DespachoR.SelectedRow.Cells[0].Text; reserva.Id_reserva = int.Parse(Session["pedido"].ToString()); reserva.Fecha_despacho = DateTime.Now; datos = user.actualizardespacho1(reserva); Response.Redirect(datos.Url); }
protected void BT_Pagar_Click(object sender, EventArgs e) { ClientScriptManager cm = this.ClientScript; L_Persistencia user = new L_Persistencia(); UReservation datos = new UReservation(); UReserva mensaje = new UReserva(); datos.Id_usuario = int.Parse(Session["user_id"].ToString()); mensaje.Mensaje = Session["men"].ToString(); mensaje = user.pago(datos, mensaje); this.RegisterStartupScript("mensaje", mensaje.Mensaje); Session["user_id"] = null; }
public String Ofertas() { try { if (SoapHeader == null) { throw new Exception("Requiere validacion"); } if (!SoapHeader.blCredencialesValidas(SoapHeader)) { throw new Exception("Requiere validacion"); } L_Persistencia datos = new L_Persistencia(); Ofertas m = new Ofertas(); UUser dato = new UUser(); DataTable data = datos.ToDataTable(datos.obtenerOferta()); DataTable d = new DataTable(); d.Columns.Add("id"); d.Columns.Add("nombre"); d.Columns.Add("descripcion"); d.Columns.Add("precio"); d.Columns.Add("oferta"); d.Columns.Add("imagen"); d.AcceptChanges(); int i = 0; foreach (DataRow dat in data.Rows) { m.Id_ofertas = int.Parse(data.Rows[i]["id_plato"].ToString()); m.Nombre = data.Rows[i]["nombre"].ToString(); m.Descripcion = data.Rows[i]["descripcion"].ToString(); m.Precio = data.Rows[i]["precio"].ToString(); m.Oferta = data.Rows[i]["oferta"].ToString(); String img = data.Rows[i]["imagen"].ToString(); String a = img.Replace("~", ""); m.Imagen = "http://localhost:53180" + a; d.Rows.Add(m.Id_ofertas, m.Nombre, m.Descripcion, m.Precio, m.Oferta, m.Imagen); i++; } String datas = JsonConvert.SerializeObject(d); return(datas); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Cache.SetNoStore(); Int32 FORMULARIO = 8; LIdioma idioma = new LIdioma(); UIdioma com = new UIdioma(); try { int DDL = int.Parse(Session["ddl"].ToString()); com = idioma.idiomaListaclientes(FORMULARIO, DDL); } catch { int DDL = 1; com = idioma.idiomaListaclientes(FORMULARIO, DDL); } Hashtable compIdioma = new Hashtable(); Session["mensajes"] = compIdioma; //for (int i = 0; i < info.Rows.Count; i++) //{ // compIdioma.Add(info.Rows[i]["control"].ToString(), info.Rows[i]["valor"].ToString()); //} LB_listClien.Text = com.A; LB_Buscar.Text = com.B; BT_Buscar.Text = com.C; REV_Username.Text = com.D; RFV_alerta.Text = com.E; GV_listClien.Columns[0].HeaderText = com.F; GV_listClien.Columns[1].HeaderText = com.G; GV_listClien.Columns[2].HeaderText = com.H; GV_listClien.Columns[3].HeaderText = com.I; GV_listClien.Columns[4].HeaderText = com.J; GV_listClien.Columns[5].HeaderText = com.K; LUser dato = new LUser(); L_Persistencia data = new L_Persistencia(); GV_listClien.DataSource = data.listadeClientes(); GV_listClien.DataBind(); }
protected UReportes ObtenerInforme() { DataRow fila; //dr DataTable informacion = new DataTable(); //dt L_Persistencia report = new L_Persistencia(); UReportes datos = new UReportes(); LUser persona = new LUser(); DataTable inter = report.ToDataTable(report.obtenerReporteReserva()); informacion = datos.Tables["Reservas"]; //DataTable intermedio = report.ToDataTable(report.obtenerReporteEmpleado()); report.obtenerinformeR(inter, informacion); return(datos); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Cache.SetNoStore(); L_Persistencia user = new L_Persistencia(); UUsuario datos = new UUsuario(); datos.Session = Session.SessionID; datos.User_Name1 = Session["name"].ToString(); datos = user.Cerrar(datos); Session["user_id"] = null; Session["nombre"] = null; Response.Redirect(datos.Mensaje); Response.Cookies.Clear(); }
protected UReportes ObtenerInforme() { DataRow fila; //dr DataTable informacion = new DataTable(); //dt L_Persistencia report = new L_Persistencia(); UReportes datos = new UReportes(); LUser persona = new LUser(); //DataTable inter = report.ToDataTable(report.obtenerReporteVentas()); informacion = datos.Tables["Pedido"]; DataTable intermedio = report.ToDataTable(report.obtenerReporteVentas()); report.obtenerinfomeV(intermedio, informacion); return(datos); }
protected void BT_Eliminar_Click1(object sender, EventArgs e) { UUser datos = new UUser(); LUser user = new LUser(); Mesas mesas = new Mesas(); L_Persistencia logica = new L_Persistencia(); ClientScriptManager cm = this.ClientScript; mesas.Id_mesas = int.Parse(Session["id_mesa"].ToString()); Int32 nombre = mesas.Id_mesas; DataTable regis = user.ToDataTable(user.obtenerMes(nombre)); String esquema = "usuario"; String tabla = "mesas"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; user.delete(regis, esquema, tabla, pk, session); logica.BorrarMesa(mesas); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('Mesa Eliminada Correctamente');window.location=\"ListarMesas.aspx\"</script>"); }
protected void TB_Filtro_TextChanged(object sender, EventArgs e) { L_Persistencia dato = new L_Persistencia(); UUser datos = new UUser(); ClientScriptManager cm = this.ClientScript; String nombre = TB_Filtro.Text.ToString(); // datos.Nombre = nombre; try { DataTable validez = dato.ToDataTable(dato.buscarPlatos(nombre)); datos.X = int.Parse(validez.Rows[0]["id_plato"].ToString()); GV_Platos.DataSource = dato.buscarPlatos((TB_Filtro.Text.ToString())); GV_Platos.DataBind(); } catch { this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + Session["buscarp"].ToString() + "');window.location=\"ListadePlatos.aspx\"</script>"); } }
protected void B_Modificar_Click(object sender, EventArgs e) { UuserCrear data = new UuserCrear(); data.Ispos = IsPostBack; LUser user = new LUser(); LUser ins = new LUser(); L_Persistencia logica = new L_Persistencia(); Menu menu = new Menu(); //user.ispost1(data); UUser info = new UUser(); info.Ruta = (FU_imagen.PostedFile.FileName); menu.Imagen = cargarImagen(); //user.ispost1(data); String nombre = Session["nombrep"].ToString(); DataTable validez1 = user.obtenerMesa(nombre); Int32 User_id = int.Parse(validez1.Rows[0]["id_plato"].ToString()); menu.Id_plato = User_id; menu.Nombre = TB_nompla.Text; //data.B = Session["nombre"].ToString(); menu.Descripcion = TB_desc.Text; //data.D = Session["descripcion"].ToString(); menu.Precio = TB_precio.Text; //data.F = Session["precio"].ToString(); //data.Ispos = prueba(info); //ins.aux1(data); DataTable regis = ins.ToDataTable(ins.obtenerMen(nombre)); String esquema = "usuario"; String tabla = "platos"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; data = logica.actualizarMenu(menu); user.updateMenu(regis, menu, esquema, tabla, pk, session); }
protected void BT_Nuevo_Click(object sender, EventArgs e) { UUser datos = new UUser(); LUser user = new LUser(); ClientScriptManager cm = this.ClientScript; L_Persistencia logica = new L_Persistencia(); Mesas mesas = new Mesas(); mesas.Cantidad = int.Parse(TB_Cantidad.Text.ToString()); mesas.Ubicacion = TB_Ubicacion.Text.ToString(); datos = logica.insertarmesas(mesas); DataTable regis = user.ToDataTable(user.obtenerAMesa()); String esquema = "usuario"; String tabla = "mesas"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; user.insert(regis, esquema, tabla, pk, session); String mens = Session["men"].ToString(); this.RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + mens.ToString() + "');window.location=\"ListarMesas.aspx\"</script>"); }
protected void BT_Agregar_Click(object sender, EventArgs e) { UAidioma user = new UAidioma(); L_Persistencia datos = new L_Persistencia(); //LIdioma datos = new LIdioma(); UIdioma idioma = new UIdioma(); LUser data = new LUser(); user.Nombre = TB_Nombre.Text.ToString(); user.Terminacion = TB_Terminacion.Text.ToString(); idioma.Mensaje = Session["men"].ToString(); idioma.A = Session["men3"].ToString(); //idioma = datos.insertarIdioma(user,idioma); idioma = datos.insertarIdioma(user, idioma); DataTable regis = data.ToDataTable(data.obtenerAdiomas()); String esquema = "idioma"; String tabla = "idioma"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; data.insert(regis, esquema, tabla, pk, session); this.RegisterStartupScript("mensaje", idioma.Mensaje); }
protected void BT_ModificarC_Click(object sender, EventArgs e) { UControles user = new UControles(); L_Persistencia datos = new L_Persistencia(); UIdioma mensaje = new UIdioma(); LUser data = new LUser(); user.Texto = TB_Texto.Text.ToString(); user.Id = int.Parse(Session["id"].ToString()); user.Control = Session["control"].ToString(); user.Idioma_id = int.Parse(Session["idioma_id"].ToString()); user.Formulario_id = int.Parse(Session["formulario_id"].ToString()); mensaje.Mensaje = Session["men4"].ToString(); String text = user.Texto; DataTable regis = data.ToDataTable(data.obtenerModiControles(text)); String esquema = "idioma"; String tabla = "controles"; String pk = Session["user_id"].ToString(); String session = Session.SessionID; mensaje = datos.modificarIdioma(user, mensaje); data.updateIdioma(regis, user, esquema, tabla, pk, session); this.RegisterStartupScript("mensaje", mensaje.Mensaje); }