Ejemplo n.º 1
0
        private void label1_Click(object sender, EventArgs e)
        {
            main_menu f = new main_menu();

            this.Hide();
            f.ShowDialog();
            this.Close();
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (instance != null)
        {
            DestroyObject(this.gameObject);
            return;
        }

        instance  = this;
        this.sr   = this.GetComponent <SpriteRenderer>();
        this.anim = this.GetComponent <Animator>();
    }
Ejemplo n.º 3
0
    private void Awake()
    {
        instance = this;

        if (PlayerPrefs.GetInt("currentMode") == 4)
        {
            PlayerPrefs.SetInt("currentMode", 1);
        }
        if (!PlayerPrefs.HasKey("startReward"))
        {
            PlayerPrefs.SetInt("cash", 100);
            PlayerPrefs.SetInt("startReward", 1);
        }
        if (!PlayerPrefs.HasKey("LanguageIndex"))
        {
            PanalOpen(LanguagePanal);
        }
    }
        private void login_butt_Click(object sender, EventArgs e)
        {
            string        connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\tesodot.mdf;Integrated Security=True;Connect Timeout=30";
            SqlConnection conn             = new SqlConnection(connectionString);

            string query = "Select *" +
                           " From Project_Manager" +
                           " Where eID = \'" + username_text.Text + "\' and pmPassword = \'" + pass_text.Text + "\'";

            string query1 = "Select *" +
                            " From Administrator" +
                            " Where eID = \'" + username_text.Text + "\' and adminPassword = \'" + pass_text.Text + "\'";

            SqlDataAdapter sqlData = new SqlDataAdapter(query, conn);
            DataTable      table   = new DataTable();

            sqlData.Fill(table);

            SqlDataAdapter sqlData1 = new SqlDataAdapter(query1, conn);
            DataTable      table1   = new DataTable();

            sqlData1.Fill(table1);


            if (table.Rows.Count == 1 || table1.Rows.Count == 1)
            {
                this.Hide();
                main_menu menu = new main_menu();
                menu.Closed += (s, args) => this.Close();
                menu.Show();
            }
            else
            {
                string message = "שם המשתמש או הסיסמא שגויים";
                string title   = "שגיאה";
                MessageBox.Show(message, title);
            }
        }