예제 #1
0
        private void BtnSup_Click(object sender, EventArgs e)
        {
            SupplierFrm supfrm = new SupplierFrm();

            if (!FrmValid.checkformopen(supfrm.Text))
            {
                supfrm.Show();
                this.Close();
            }
        }
예제 #2
0
        private void BtnProducts_Click(object sender, EventArgs e)
        {
            ProductFrm prodfrm = new ProductFrm();


            if (!FrmValid.checkformopen(prodfrm.Text))
            {
                prodfrm.Show();
                this.Close();
            }
        }
예제 #3
0
        private void BtnProdSup_Click(object sender, EventArgs e)
        {
            ProdSupFrm prodsupfrm = new ProdSupFrm();

            string strtitle = "Packages";

            if (!FrmValid.checkformopen(strtitle))
            {
                prodsupfrm.Show();
                this.Close();
            }
        }
예제 #4
0
        private void BtnMain_Click(object sender, EventArgs e)
        {
            MainFrm main = new MainFrm();

            if (!FrmValid.checkformopen(main.Text))
            {
                main.Show();
                this.Close();
            }
            else
            {
                main.Activate();
                this.Close();
            }
        }
예제 #5
0
        private void BtnLogout_Click(object sender, EventArgs e)
        {
            LoginFrm loginfrm = new LoginFrm();

            if (!FrmValid.checkformopen(loginfrm.Text))
            {
                FrmValid.AgentId = 0;
                loginfrm.Show();
            }
            else
            {
                FrmValid.Activateform(loginfrm.Text);
                this.Close();
            }
        }
예제 #6
0
 private void BtnLogin_Click(object sender, EventArgs e)
 {
     if (validation())
     {
         AgentLogin agent = new AgentLogin();
         agent.nAgentId    = Convert.ToInt32(txtUsrID.Text);
         agent.strPassword = GetHashString(txtPwd.Text);
         if (AgentLogInDB.CheckIDexist(agent.nAgentId))
         {
             if (AgentLogInDB.CheckPwdMatch(agent))
             {
                 MainFrm mainfrm = new MainFrm();
                 if (!FrmValid.checkformopen(mainfrm.Text))
                 {
                     FrmValid.AgentId = agent.nAgentId;
                     //this.Close();
                     mainfrm.Show();
                     this.Visible = false;
                 }
             }
             else
             {
                 CustMesg msgfrm = new CustMesg();
                 msgfrm.Showmsg("Password Wrong!");
                 msgfrm.Show();
                 //MessageBox.Show("Password Wrong!");
             }
         }
         else
         {
             CustMesg msgfrm = new CustMesg();
             msgfrm.Showmsg("User is not exist!");
             msgfrm.Show();
             //MessageBox.Show("User is not exist!");
         }
     }
 }