Пример #1
0
        private void btn1_GD_view_Click(object sender, EventArgs e)
        {
            ConnectToMySQL dbc = new ConnectToMySQL(user_id_lbl.Text, user_hash_lbl.Text);
            FormFunctions fFunc = new FormFunctions(user_id_lbl.Text, user_hash_lbl.Text);

            if (fFunc.checkSession(user_hash_lbl.Text.ToString(), double.Parse(ConfigurationManager.AppSettings["session_expiry"])) == false)
            {
                MessageBox.Show("Login expired ! Please login again.");
                loginEnable();
                tabControl1.SelectedTab = tabPage0;
            }
            else
            {
                TabControlGlobal TCG = new TabControlGlobal(user_id_lbl.Text, user_hash_lbl.Text);
                dbTableFunctions dbFunc = new dbTableFunctions(user_id_lbl.Text, user_hash_lbl.Text);

                GD_view_listView.Clear();
                GD_view_listView.View = View.Details;
                //fFunc.popListViewT(listView1, "po_details");

                DataSet ds = new DataSet();
                ds = dbc.SelectMyDA("SELECT * FROM po_details;");
                fFunc.popListViewDS(GD_view_listView, ds);

                //string query = "UPDATE `po_details` SET `job_number`= \"" + txtBox_gang_num.Text + "\", po_number = \"" + po_number_txtBox1.Text + "\", gang_number = \"" + gang_number_txtBox1.Text + "\" WHERE  `id`=1 LIMIT 1; ";
                //dbc.Update(query);
            }
        }
Пример #2
0
        private void connect_btn_Click(object sender, EventArgs e)
        {
            TabControlGlobal TCG = new TabControlGlobal(user_id_lbl.Text, user_hash_lbl.Text);
            TCG.StoreLogin(username.Text, password.Text);

            //label3.Text = TCG.loginPass.ToString();
            label3.Text = " " + TCG.loginError; // Display login error

            if (TCG.loginPass != 0)
            {
                TCG.RecordUserSession(); // ENABLE it.
                EnableTabs(TCG.deptID_str_arr);
                user_id_lbl.Text = TCG.user_id.ToString();
                user_hash_lbl.Text = TCG.user_hash.ToString();
                loginDisable();
                //tabControl1.TabPages.Remove(tabPage1); // to hide particular TabPage
            }
        }