Beispiel #1
0
        private void Register_New_User_Load(object sender, EventArgs e)
        {
            string sql   = "select count(UserName) from Login";
            int    count = db.GetIntValue(sql);

            if (count > 0)
            {
                txtuid.Text = count.ToString();
            }
            else
            {
                txtuid.Text = txtuid.Text;
            }
        }
Beispiel #2
0
        private void Treatments_Load(object sender, EventArgs e)
        {
            string sql  = "select count(Treatment_ID)  from Treatment;";
            string sql1 = "select Patient_Name from Patient_Details";

            count = db.GetIntValue(sql);
            // set data from database to combo box
            comboxPname.DataSource    = db.SelectOneColumn(sql1).Tables[0];
            comboxPname.DisplayMember = "Patient_Name";

            comboxPname.Text    = "Select Patient";
            dateTreatment.Value = DateTime.Today;

            txttid.Text = (count + 1).ToString();
        }
Beispiel #3
0
        static void Main()
        {
            if (!db.checkDatabaseExist())
            {
                db.GenerateDatabase();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            int ck = db.GetIntValue("select count(UserName) from Login;");

            if (ck == 0)
            {
                MessageBox.Show("No User Account, Please Add User First", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Application.Run(new Register_New_User());
            }
            else
            {
                Application.Run(new Login());
            }
        }
Beispiel #4
0
 public int dataCount(string sql)
 {
     return(db.GetIntValue(sql));
 }