Beispiel #1
0
        protected void FButton_Click(object sender, EventArgs e)
        {
            this.GridView1.Visible = true;
            CatalogRestaurant rest     = new CatalogRestaurant();
            List <Restaurant> listrest = rest.findLocal(this.NTextBox.Text);

            this.GridView1.DataSource = listrest;
            this.DataBind();
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.GridView1.Visible = false;
            CatalogRestaurant rest     = new CatalogRestaurant();
            List <Restaurant> listrest = rest.findLocal("");

            this.GridView1.DataSource = listrest;
            this.DataBind();
        }
/**
 *      public void show()
 *      {
 *          this.GridView1.Visible = true;
 *          CatalogRestaurant clocal = new CatalogRestaurant();
 *          List<Restaurant> llocal = new List<Restaurant>();
 *          string t = this.txtrest.Text;
 *          if (t == null)
 *              t = "";
 *          llocal = clocal.findLocal(t);
 *          // this.GridView1.DataSource = llocal;
 *          // this.DataBind();
 *      }
 **/
        protected void btnaceptar_Click(object sender, EventArgs e)
        {
            this.GridView1.Visible = true;
            CatalogRestaurant rest         = new CatalogRestaurant();
            DateTime          dateatencion = Convert.ToDateTime(this.GridView1.SelectedRow);
            List <Restaurant> listrest     = rest.findLocal(this.txtrest.Text);

            this.GridView1.DataSource = listrest;
            this.DataBind();
        }
Beispiel #4
0
        public void show()
        {
            this.GridView1.Visible = true;
            CatalogRestaurant clocal = new CatalogRestaurant();
            List <Restaurant> llocal = new List <Restaurant>();
            string            t      = this.NTextBox.Text;

            if (t == null)
            {
                t = "";
            }
            llocal = clocal.findLocal(t);
            // this.GridView1.DataSource = llocal;
            // this.DataBind();
        }
Beispiel #5
0
        protected void btnrestaurant_Click(object sender, EventArgs e)
        {
            CatalogRestaurant catrest = new CatalogRestaurant();
            Restaurant        rest    = new Restaurant();
            bool ok = catrest.LoginRest(txtemail.Text, txtpass.Text);

            if (ok)
            {
                Session["ok"] = true;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('LOGIN OK')", true);
                rest = catrest.ReturnNombre(txtemail.Text, txtpass.Text);
                Session["NOMBRE_REST"] = rest.Nombre_rest.ToString();
                String Valor = txtemail.Text;
                Response.Redirect("AgregarPlato.aspx?Valor=" + Valor);
                //Session["NOMBRE_REST"] = catrest.ReturnNombre(txtrut.Text, txtpass.Text);
                Response.Redirect("AgregarPlato.aspx");
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('LOGIN IS WRONG')", true);
            }
        }
Beispiel #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CatalogAdministrador catad = new CatalogAdministrador();

            if (catad.ComprobarFormatoEmail(txtcorreo.Text) == false)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error en el formato del correo ingresado')", true);
            }
            else
            {
                if (txtpass.Text == txtpass2.Text)
                {
                    CatalogRestaurant catrest      = new CatalogRestaurant();
                    DateTime          dateatencion = Convert.ToDateTime(this.txtatencion.Text);
                    DateTime          datecierre   = Convert.ToDateTime(this.txtcierre.Text);
                    Restaurant        rest         = new Restaurant(this.txtpass.Text, this.txtnombre.Text, this.txtdir.Text, this.txtciudad.Text, dateatencion, datecierre, this.txtcorreo.Text, this.txttel.Text);
                    catrest.insertRest(rest);
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Restaurant agregado correctamente')", true);
                    txtpass.Text     = "";
                    txtnombre.Text   = "";
                    txtdir.Text      = "";
                    txtcierre.Text   = "";
                    txtatencion.Text = "";
                    txtcierre.Text   = "";
                    txtcorreo.Text   = "";
                    txttel.Text      = "";
                    txtpass2.Text    = "";
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error! Las contraseñas no coinciden.')", true);
                    txtpass.Text  = "";
                    txtpass2.Text = "";
                }
            }
        }