protected void btEnter_Click(object sender, EventArgs e) { DBprocedure procedures = new DBprocedure(); DBconnection connection = new DBconnection(); connection.dbEnter(tbLogin.Text, tbPassword.Text); switch (DBconnection.IDuser) { case (0): tbLogin.BackColor = System.Drawing.Color.Red; tbPassword.BackColor = System.Drawing.Color.Red; lblTitle.Text = "Введён не верный логнин или пароль!"; tbPassword.Text = ""; tbLogin.Text = ""; break; default: DBconnection.strDostup = procedures.fDostup(tbLogin.Text, tbPassword.Text); Response.Redirect("MainPage.aspx"); break; } }
protected void Page_Load(object sender, EventArgs e) { DBprocedure procedures = new DBprocedure(); procedures.fDostup(DBconnection.Log, DBconnection.Pass); foreach (char dost in DBconnection.strDostup) { if (dost == '1') { Button1.Visible = false; Button2.Visible = false; Button3.Visible = false; Button4.Visible = false; Button5.Visible = false; Button7.Visible = false; Button8.Visible = false; Button9.Visible = false; //Button10.Visible = false; Button11.Visible = false; } } }