Example #1
0
 private void btn_UserManager_Click(object sender, EventArgs e)
 {
     UserManager usr_mangaer = new UserManager(this.ParentForm, this);
     usr_mangaer.ShowDialog();
 }
Example #2
0
        public bool Login()
        {
            string Err = null;
            if (Read_Login_VIEW(ref Err))
            {
                if (dtLogin_Vaild(ref Err))
                {
                    return DoLogin();
                }
                else
                {
                    // Login as SuperAdministrator to edit Login Tables !
                    LoginSuperAdministratorForm lgsForm = new LoginSuperAdministratorForm();
                    if (lgsForm.ShowDialog() == DialogResult.OK)
                    {
                        DataRow[] dr = m_Login_VIEW.dt.Select(LoginDB_DataSet.Login_VIEW.username.name + " = 'Administrator'");
                        if (dr != null)
                        {
                            m_LoginData.m_LoginUsers_id = (int) dr[0][LoginDB_DataSet.Login_VIEW.Users_id.name];

                            UserManager edtLogin = new UserManager(null,this);
                            if (edtLogin.ShowDialog() == DialogResult.OK)
                            {
                                if (Read_Login_VIEW(ref Err))
                                {
                                    if (dtLogin_Vaild(ref Err))
                                    {
                                        return DoLogin();
                                    }
                                    else
                                    {
                                        LogFile.Error.Show("ERROR:LoginControl:Login: Read Login data Tables are not valid:" + Err);
                                        return false;
                                    }
                                }
                                else
                                {
                                    LogFile.Error.Show("ERROR:LoginControl:Login: Read Login_VIEW Err=:" + Err);
                                    return false;
                                }
                            }
                            else
                            {
                                return false;
                            }
                        }
                    }
                }
                return false;
            }
            else
            {
                LogFile.Error.Show("ERROR LOGIN !: Read Login Tables :" + Err);
                return false;
            }
        }