Пример #1
0
        protected void SubmitBtn_Click(Object sender, EventArgs e)
        {
            string        str2 = null;
            List <string> lst2;
            string        index = DropDownList.SelectedItem.Text;

            lst2 = DB.UserLookUp(index);
            foreach (string s in lst2)
            {
                str2 += " | " + s;
            }
            Label1.Text = str2;
        }
Пример #2
0
        // GridView Button command
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            List <string> lst;
            string        str   = null;
            string        index = null;
            int           intIndex;

            // Checks if CommandName "cmd" had been call (could be more then one button in a raw)
            if (e.CommandName == "cmd")
            {
                intIndex = Convert.ToInt32(e.CommandArgument) + 1;
                index    = "" + intIndex;

                lst = DB.UserLookUp(index);
                foreach (string s in lst)
                {
                    str += " | " + s;
                }

                lblRow.Text = str;
            }
        }
Пример #3
0
        // OK Button method for
        protected void Validation(object sender, EventArgs e)
        {
            List <string> lst = null;

            // Check info with database
            DB.Connect();
            string idx = DB.IsUser(txtName.Text, txtPass.Text);

            if (idx != null)
            {
                // Gets list of table Customers about the user
                lst = DB.UserLookUp(idx);

                // Insert into Page Application the User info
                Application.Add("Idx", lst[0]);
                Application.Add("Name", lst[1]);
                Application.Add("Family", lst[2]);
                Application.Add("Address", lst[3]);
                Application.Add("CityNum", lst[4]);
                Application.Add("Phone", lst[5]);

                lst.Clear();
                DB.Disconnect();
                Response.Redirect("Welcome.aspx");
            }
            // Check if admin
            else if (DB.IsAdmin(txtName.Text, txtPass.Text))
            {
                DB.Disconnect();
                Response.Redirect("administrator.aspx");
            }
            // User not exsit
            else
            {
                DB.Disconnect();
                Response.Redirect("Error.aspx");
            }
        }