示例#1
0
文件: frmMain.cs 项目: rjporosh/PoS
        private void registerSoftwareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(Properties.Settings.Default["isActivated"].ToString());
            InsertKey ik = new InsertKey();

            ik.button1.Visible = true;
            ik.ShowDialog();
        }
示例#2
0
文件: frmLogin.cs 项目: hasin222/POS
        private void trialVersionSecurity()
        {
            //security
            if (Properties.Settings.Default["isActivated"].Equals("False"))//isActivated
            {
                sqlconnect = new SqlConnection(c);
                sqlcmd     = new SqlCommand("insert into Log(id) values (1)", sqlconnect);
                sqlconnect.Open();
                sqlcmd.ExecuteNonQuery();
                sqlconnect.Close();

                sqlconnect = new SqlConnection(c);
                sqlcmd     = new SqlCommand("select * from Log", sqlconnect);
                sqlda      = new SqlDataAdapter(sqlcmd.CommandText, sqlconnect);
                sqlds      = new DataSet();
                sqlda.Fill(sqlds, "login");

                int count = Convert.ToInt32(sqlds.Tables["login"].Rows.Count);
                if (count > 300)
                {
                    InsertKey ik = new InsertKey();
                    ik.ShowDialog();
                    this.Hide();
                }
                else
                {
                    frmMain mainform = new frmMain();
                    mainform.Show();
                    this.Hide();
                }
            }
            else //isActivated
            {
                frmMain mainform = new frmMain();
                mainform.Show();
                this.Hide();
            }
        }