示例#1
0
        private void FrmScholarshipPaymentReceipt_FormClosing(object sender, FormClosingEventArgs e)
        {
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
示例#2
0
        private void FrmSupplier_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
示例#3
0
        private void frmBusFeePaymentsReport_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
示例#4
0
        private void frmTrasportation_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
        private void frmStudentBookIssue_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
示例#6
0
        private void frmHostelerRecords1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.ShowDialog();
        }
示例#7
0
        private void frmscholarshippaymentRecord1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.ShowDialog();
        }
示例#8
0
        private void frmSalaryPaymentreport1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();;
        }
        private void frmEmployeePaymentRecord1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.Show();
        }
示例#10
0
        private void frmBookReturnRecord_Staff_1_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frm_Main_Menu frm = new frm_Main_Menu();

            frm.UserType.Text = lblUserType.Text;
            frm.User.Text     = lblUser.Text;
            frm.ShowDialog();
        }
示例#11
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (cmbUsertype.Text == "")
            {
                MessageBox.Show("Please select user type", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                cmbUsertype.Focus();
                return;
            }
            if (UserID.Text == "")
            {
                MessageBox.Show("Please enter user ID", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                UserID.Focus();
                return;
            }
            if (Password.Text == "")
            {
                MessageBox.Show("Please enter password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Password.Focus();
                return;
            }
            try
            {
                con = new SqlConnection(cs.DBcon);
                con.Open();
                cmd             = con.CreateCommand();
                cmd.CommandText = "SELECT RTRIM(UserID),RTRIM(Password) FROM User_Registration where UserID = @d1 and Password=@d2";
                cmd.Parameters.AddWithValue("@d1", UserID.Text);
                cmd.Parameters.AddWithValue("@d2", Password.Text);
                rdr = cmd.ExecuteReader();
                if (rdr.Read())
                {
                    con = new SqlConnection(cs.DBcon);
                    con.Open();
                    cmd             = con.CreateCommand();
                    cmd.CommandText = "SELECT usertype FROM User_Registration where UserID=@d3 and Password=@d4";
                    cmd.Parameters.AddWithValue("@d3", UserID.Text);
                    cmd.Parameters.AddWithValue("@d4", Password.Text);
                    rdr = cmd.ExecuteReader();
                    if (rdr.Read())
                    {
                        cmbUsertype.Text = rdr.GetValue(0).ToString().Trim();
                    }
                    if ((rdr != null))
                    {
                        rdr.Close();
                    }
                    if (con.State == ConnectionState.Open)
                    {
                        con.Close();
                    }


                    if (cmbUsertype.Text == "Librarian")
                    {
                        this.Hide();
                        Librarian_Window frm = new Librarian_Window();
                        frm.User.Text     = UserID.Text;
                        frm.UserType.Text = cmbUsertype.Text;
                        frm.Show();

                        ProgressBar1.Visible = true;
                        ProgressBar1.Maximum = 5000;
                        ProgressBar1.Minimum = 0;
                        ProgressBar1.Value   = 4;
                        ProgressBar1.Step    = 1;
                        for (int i = 0; i <= 5000; i++)
                        {
                            ProgressBar1.PerformStep();
                        }
                    }
                    if (cmbUsertype.Text == "Account Officer")
                    {
                        this.Hide();
                        Account_Officer_Window frm = new Account_Officer_Window();
                        frm.User.Text     = UserID.Text;
                        frm.UserType.Text = cmbUsertype.Text;
                        frm.Show();

                        ProgressBar1.Visible = true;
                        ProgressBar1.Maximum = 5000;
                        ProgressBar1.Minimum = 0;
                        ProgressBar1.Value   = 4;
                        ProgressBar1.Step    = 1;
                        for (int i = 0; i <= 5000; i++)
                        {
                            ProgressBar1.PerformStep();
                        }

                        /*st1 = UserID.Text;
                         * st2 = "Successfully logged in";
                         * cf.LogFunc(st1, System.DateTime.Now, st2);
                         * this.Hide();
                         * frm.Show();*/
                    }


                    if (cmbUsertype.Text == "Admin")
                    {
                        this.Hide();
                        frm_Main_Menu frm = new frm_Main_Menu();
                        //frm.User.Text = txtUserName.Text;
                        frm.User.Text     = UserID.Text;
                        frm.UserType.Text = cmbUsertype.Text;
                        frm.Show();
                        // frm.registrationToolStripMenuItem2.Enabled = true;
                        frm.studentDetailsToolStripMenuItem.Enabled = true;

                        frm.hostelersToolStripMenuItem.Enabled  = true;
                        frm.busHoldersToolStripMenuItem.Enabled = true;


                        frm.Master_entryMenu.Enabled             = true;
                        frm.usersToolStripMenuItem.Enabled       = true;
                        frm.studentToolStripMenuItem.Enabled     = true;
                        frm.employeeToolStripMenuItem.Enabled    = true;
                        frm.transactionToolStripMenuItem.Enabled = true;
                        frm.searchToolStripMenuItem.Enabled      = true;
                        frm.reportToolStripMenuItem.Enabled      = true;


                        frm.busFeePaymentToolStripMenuItem2.Enabled     = true;
                        frm.feePaymentToolStripMenuItem.Enabled         = true;
                        frm.employeeSalaryToolStripMenuItem.Enabled     = true;
                        frm.hostelFeesPaymentToolStripMenuItem.Enabled  = true;
                        frm.scholarshipPaymentToolStripMenuItem.Enabled = true;
                        ProgressBar1.Visible = true;
                        ProgressBar1.Maximum = 5000;
                        ProgressBar1.Minimum = 0;
                        ProgressBar1.Value   = 4;
                        ProgressBar1.Step    = 1;
                        for (int i = 0; i <= 5000; i++)
                        {
                            ProgressBar1.PerformStep();
                        }
                        st1 = UserID.Text;
                        st2 = "Successfully logged in";
                        cf.LogFunc(st1, System.DateTime.Now, st2);
                        this.Hide();
                        frm.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Login Failed...Try again !", "Login Denied", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    UserID.Clear();
                    Password.Clear();
                    UserID.Focus();
                }
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }