コード例 #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            //חזרה לחלון הראשי
            this.Hide();
            EventSeatingManager eventseatingmanager = new EventSeatingManager();

            eventseatingmanager.ShowDialog();
        }
コード例 #2
0
        private void btnSignIn_Click(object sender, EventArgs e)
        {
            if (txtUserName.Text == "" || txtPassword.Text == "")
            {
                MessageBox.Show("please insert user name and password");
            }
            bool tryFlag = false; // משתנה שבודק אם הניסיון לכתוב לבסיס הנתונים הצליח

            try
            {
                Finel_ProjectDataSetTableAdapters.EVENT_OWNERSTableAdapter user = new Finel_ProjectDataSetTableAdapters.EVENT_OWNERSTableAdapter();
                Finel_ProjectDataSet.EVENT_OWNERSDataTable dt = user.GetDataByUserNameAndPassword(txtUserName.Text, txtPassword.Text);
                if (dt.Rows.Count == 1)
                {
                    EventSeatingManager.globalusername = txtUserName.Text;
                    EnableBtnFlag = true;
                    tryFlag       = true;
                }

                else if (dt.Rows.Count > 1)
                {
                    MessageBox.Show("Duplicate User Name!");
                    tryFlag = false;
                }
                else
                {
                    MessageBox.Show("Incorrect user name or password");
                    tryFlag = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (tryFlag == true)
            {
                this.Close();
                EventSeatingManager eventseatingmanager = new EventSeatingManager();
                eventseatingmanager.ShowDialog();
                this.Close();
            }
        }