static void Main(string[] args) { _autherService = new AuthService(API_CONNECTIONSTRING); BEARER_TOKEN = LoginMenu(); _menu1 = new Menu1(API_CONNECTIONSTRING, BEARER_TOKEN, DATASTREAM_URL); _menu1.RunMenu1(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["isLoginIn"] == "True") { } else { string id = Request.Params["userId"]; string pwd = Request.Params["pwd"]; if (pwd == "123@fabnfresh" && id == "fabnfresh") { Session["isLoginIn"] = "True"; } else { Response.Redirect("login.html"); } } System.Collections.IList visibleTables = ASP.global_asax.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MenuItem membertools = Menu1.FindItem("Member Options"); Menu1.Items.Remove(membertools); if (Session["Name"] != null) //are you logged in? { if (Session["Member"] != null) { if ((bool)Session["Member"]) { Menu1.Items.Add(membertools); } } } else if (Session["Member"] == null) { Response.Redirect("Home.aspx"); //Prevent people from hard coding to gain access } } if (RadioButtonList1.SelectedIndex == 0) { TextBox2.Text = "25$"; } else if (RadioButtonList1.SelectedIndex == 1) { TextBox2.Text = "10$"; } TextBox1.Text = Session["Name"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { MenuItem item = Menu1.FindItem("Login"); MenuItem item2 = Menu1.FindItem("Home"); MenuItem item3 = Menu1.FindItem("Policies"); MenuItem item4 = Menu1.FindItem("Hospitals"); MenuItem item5 = Menu1.FindItem("Claim"); //if (((Label)Master.FindControl("lblErrMsg")).Text == "") //{ // item.Enabled = true; // item2.Enabled = true; // item3.Enabled = true; // item4.Enabled = true; // item5.Enabled = true; //} //else //{ // item.Enabled = false; // item2.Enabled = false; // item3.Enabled = false; // item4.Enabled = false; // item5.Enabled = false; //} }
public int UpdateFood(Menu1 menu) { string query = "UPDATE Menu SET [FoodName]='" + menu.FoodName + "',[Price]='" + menu.Price + "',[Status]='" + menu.Status + "',[CategoryId]='" + menu.CategoryId + "' WHERE [FoodId]=" + menu.FoodId; //dataAccess = new DataAccess(); return(this.dataAccess.ExecuteQuery(query)); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = ASP.global_asax.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); con.Open(); String query = "SELECT * FROM [dbo].[User] WHERE Email = @email"; SqlCommand com = new SqlCommand(query, con); SqlParameter CheckEmail = new SqlParameter("@email", Session["LoginEmail"]); com.Parameters.Add(CheckEmail); SqlDataReader retrieve = com.ExecuteReader(); if (retrieve.Read()) { Name = retrieve["FirstName"].ToString(); character = retrieve["Character"].ToString(); } (this.Master).nameValue = Name; (this.Master).CharValue = character; }
public ChickenMenuRequestResponse GetPlaceMenu(string place_id) { int place_id_int = Convert.ToInt32(place_id); var client = GetClient(); var req_context = GetRequestContext(); var menu_id = GetPlaceCurrentMenuId(client, place_id_int, null); var placeMenu1 = new Menu1() { Id = menu_id }; logger.Debug("Starting GetCategoriesForMenu"); ProductCategory[] menu = client.GetCategoriesForMenu(placeMenu1, req_context); logger.Debug("GetCatagoriesForMenu complete"); foreach (var cat in client.GetCategoriesForMenu(placeMenu1, req_context)) { if (cat.Name.ToLower().Contains("chicken")) { logger.Debug("Starting GetProducts"); // We have a winner. Take the ID and fetch the actual menu var realMenu = client.GetProducts(placeMenu1, new ProductCategory1() { Id = cat.Id }, req_context); logger.Debug("GetProducts complete"); List<ChickenMenu> returner = new List<ChickenMenu>(); foreach (Product prod in realMenu) { returner.Add(new ChickenMenu(){ Name = prod.Name, Price = prod.Price, Description = prod.Description }); } return new ChickenMenuRequestResponse() { Result = returner, MenuNotes=cat.Notes }; } } return new ChickenMenuRequestResponse() { Result = null }; }
protected void btnProximoClick(object sender, EventArgs e) { MenuItem mnuItem = Menu1.FindItem("2"); mnuItem.Enabled = true; Menu1.Items[MultiView1.ActiveViewIndex = 2].Selected = true; }
public void GridCompeicoesCommand(object sender, GridViewCommandEventArgs e) { try { int n = 0; if (int.TryParse(e.CommandArgument.ToString(), out n)) { int index = Convert.ToInt32(e.CommandArgument); string idCompeticao = GridCompeicoes.DataKeys[index]["IdCompeticao"].ToString(); if (e.CommandName == "Inscrever") { Session["IdCompeticao"] = idCompeticao; MenuItem mnuItem = Menu1.FindItem("1"); mnuItem.Enabled = true; CarregaTela(long.Parse(idCompeticao)); } } } catch (Exception ex) { AlertVisibleTrue(); AlertError(ex.Message); //FailureText.Text = string.Format("Erro ao selecionar competição.{0}", ex.Message); } }
private void TrataCampos(DtoCompeticao dados) { if (dados.PermiteNaoFiliado == true) { TextNumeroRegistro.Enabled = false; TextIdAtleta.Enabled = false; TextNomeFiliado.Enabled = true; TextDtNascimento.Enabled = true; TextIdade.Enabled = true; TextPeso.Enabled = true; TextAltura.Enabled = true; DropDownListGraduacao.Enabled = true; Permite.Text = dados.PermiteNaoFiliadoDescricao; MenuItem mnuItem = Menu1.FindItem("3"); mnuItem.Enabled = true; } else { TextNumeroRegistro.Enabled = false; TextIdAtleta.Enabled = false; TextNomeFiliado.Enabled = false; TextDtNascimento.Enabled = false; TextIdade.Enabled = false; TextPeso.Enabled = false; TextAltura.Enabled = false; DropDownListGraduacao.Enabled = false; Permite.Text = dados.PermiteNaoFiliadoDescricao; } }
protected void btnSelecionaClick(object sender, EventArgs e) { try { MenuItem mnuItem = Menu1.FindItem("3"); mnuItem.Enabled = true; Menu1.Items[MultiView1.ActiveViewIndex = 3].Selected = true; Regras.Regras get = new Regras.Regras(); if (Session["IdCompeticao"] != null) { DtoCompeticao dados = get.GetCompeticaoPorId(int.Parse(Session["IdCompeticao"].ToString())); if (dados.PermiteNaoFiliado == false) { if (!string.IsNullOrWhiteSpace(ListAtletasCadastrados.SelectedValue)) { TextNumeroRegistro.Text = ListAtletasCadastrados.SelectedValue; BuscaFiliadoPorRegistro(sender, e); } } else { TextIdAtleta.Text = ListAtletasCadastrados.SelectedValue; BuscaFiliadoPorId(sender, e); } } } catch (Exception ex) { AlertVisibleTrue(); AlertError(ex.Message); } }
public List <Menu1> GetProductByCategory(string categoryName) { string categoryIdSearch = "SELECT * FROM Categories WHERE CategoryName='" + categoryName + "'"; SqlDataReader reader = this.dataAccess.GetData(categoryIdSearch); reader.Read(); int categoryId = (int)reader["CategoryId"]; string sql = "SELECT * FROM Menu WHERE CategoryId=" + categoryId; this.dataAccess = new DataAccess(); reader = this.dataAccess.GetData(sql); List <Menu1> products = new List <Menu1>(); while (reader.Read()) { Menu1 menu = new Menu1(); menu.FoodId = (int)reader["FoodId"]; menu.FoodName = reader["FoodName"].ToString(); menu.Price = Convert.ToDouble(reader["Price"]); menu.Status = reader["Status"].ToString(); menu.CategoryId = (int)reader["CategoryId"]; products.Add(menu); } return(products); }
private void checkPost() { while (true) { if (String.IsNullOrEmpty(Menu1.getSbj()) || String.IsNullOrWhiteSpace(Menu1.getSbj()) || String.IsNullOrEmpty(Menu1.getField()) || String.IsNullOrWhiteSpace(Menu1.getField()) || String.IsNullOrEmpty(Menu1.getPay()) || String.IsNullOrWhiteSpace(Menu1.getPay()) || String.IsNullOrEmpty(Menu1.getPlace()) || String.IsNullOrWhiteSpace(Menu1.getPlace())) { MessageBox.Show("텍스트 박스에 문자를 삽입하여 주세요"); break; } /* * if (Menu1.getStart().Date == Menu1.getFinish().Date || Menu1.getStart().Date == Menu1.getDead().Date) * { * MessageBox.Show("날짜를 입력하세요"); * break; * }*/ else { insertData(); break; } } }
private void Button1_Click(object sender, EventArgs e) { SqlConnection conexao = new SqlConnection(@"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=FISIO;Data Source=DESKTOP-1CA9LG5\SQLEXPRESS"); try { SqlCommand cmd = new SqlCommand("SELECT COUNT(idFuncionario) FROM FUNCIONARIO WHERE loginFuncionario = @usuario AND senhaFuncionario = @senha", conexao); cmd.Parameters.Add("@usuario", SqlDbType.VarChar).Value = tLogin.Text; cmd.Parameters.Add("@senha", SqlDbType.VarChar).Value = tSenha.Text; conexao.Open(); int v = (int)cmd.ExecuteScalar(); if (v > 0) { Menu1 entrar = new Menu1(); this.Hide(); entrar.Show(); } else { MessageBox.Show("Você não está cadastrado ou teve algum erro de inserção", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch { MessageBox.Show("Erro com banco de dados", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void opsi2_Click(object sender, EventArgs e) { Menu1.Hide(); lihatData.Hide(); opsi2.Hide(); opsi1.Show(); }
private void button_Menu_Click(object sender, EventArgs e) { Point ms = new Point(); ms.X = this.Left + button_Menu.Left; ms.Y = this.Top + button_Menu.Bottom; Menu1.Show(ms); }
private void opsi1_Click(object sender, EventArgs e) { Menu1.Show(); lihatData.Show(); opsi1.Hide(); opsi2.Show(); opsi2.Location = new System.Drawing.Point(3, 3); }
public void initialize() { start = new Start(); selection = new Selection(); menu1 = new Menu1(); menu2 = new Menu2(); state = State.START; }
protected void Page_Load(object sender, EventArgs e) { //SetMenuDataSource(eMenuToLoad); dsMenu.SiteMapProvider = "SecureSiteMap"; Menu1.Orientation = _orientation; Menu1.DataSource = dsMenu; dsMenu.ShowStartingNode = false; Menu1.DataBind(); }
public void RemoveButton(string val) { MenuItem adminBut = Menu1.FindItem(val); if (adminBut != null) { Menu1.Items.Remove(adminBut); } }
public void DataBindMenu() { if (_dataSet != null) { Menu1.DataSource = _dataSet; Menu1.DataBind(); _dataBound = true; } }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = Global.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("Нет ни одной доступной таблицы. Убедитесь, что по крайней мере одна модель данных зарегистрирована в Global.asax, а технология формирования шаблонов включена, либо реализуйте настраиваемые страницы."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = ASP.global_asax.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("No hay tablas accesibles. Asegúrese de que hay al menos un modelo de datos registrado en Global.asax y de que está habilitada la técnica scaffolding, o bien implemente páginas personalizadas."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = Global.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("沒有可存取的資料表。至少要在 Global.asax 中註冊一個資料模型,而且要啟用 Scaffolding 或實作自訂頁面。"); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = Global.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("Il n'y a aucune table accessible. Assurez-vous qu'au moins un modèle de données est inscrit dans Global.asax et que la génération de modèles automatique est activée, ou implémentez des pages personnalisées."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = Global.DefaultModel.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages."); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { System.Collections.IList visibleTables = MetaModel.Default.VisibleTables; if (visibleTables.Count == 0) { throw new InvalidOperationException("没有可访问的表。请确保至少在 Global.asax 中注册了一个数据模型并启用了支架,或者实现自定义页。"); } Menu1.DataSource = visibleTables; Menu1.DataBind(); }
public ActionResult JsonDemo() { var m = new Menu1 { Id = 3, Text = "sdjiwjijidfjsaid", price = 12.23, Category = "Main" }; return(Json(m, JsonRequestBehavior.AllowGet)); }
protected void Page_Load(object sender, EventArgs e) { Menu1.FindItem(CurrentlySelectedItem).Selected = true; if (Page.ToString().ToLower().IndexOf("policy") != -1) { PanelPolicy.Visible = false; } else { PanelPolicy.Visible = true; } }
protected void RblDataSource_SelectedIndexChanged(object sender, EventArgs e) { string datasource = RblDataSource.SelectedValue; if (datasource == "XmlDataSource") { Menu1.DataSourceID = "XmlDataSource1"; } else { Menu1.DataSourceID = "SiteMapDataSource1"; } Menu1.DataBind(); }
public int AddFood(string foodname, string price, string status, string categoryName) { int categoryId = this.menuDataAccess.GetCategoryId(categoryName); Menu1 menu = new Menu1() { FoodName = foodname, Price = Convert.ToDouble(price), Status = status, CategoryId = categoryId }; menuDataAccess = new MenuDataAccess(); return(this.menuDataAccess.InsertFood(menu)); }
public override void OnActive() { Debug.Log ("Aktywacja StateW"); menu = GameObject.Find ("GUI").GetComponent("Menu1") as Menu1; menu.enabled = true; }