Beispiel #1
0
 private void checkLogin()
 {
     username    = Username.Text.ToString();
     password    = Password.Password.ToString();
     passwordMD5 = Methods.Encode(password);
     if (username.Length == 0 || password.Length == 0)
     {
         Error.Content = "Duhet t'i plotësoni të gjitha fushat!";
     }
     else if (username.Length == 0 || username.Length < 4)
     {
         Error.Content = "Kontrolloni username-in, duhet të jetë më shumë se 3 karaktere!";
     }
     else if (password.Length == 0 || password.Length < 6)
     {
         Error.Content = "Kontrolloni fjalëkalimin, duhet të jetë më shumë se 6 karaktere!";
     }
     else
     {
         bool res = ReadMyData(myConnectionString, username, passwordMD5);
         if (res)
         {
             if (idRoli == 2)
             {
                 //AdminWindow aW = new AdminWindow(idPerdoruesi);
                 EvidenceWindow aW = new EvidenceWindow(idPerdoruesi);
                 aW.Show();
             }
             else if (idRoli == 3)
             {
                 AdminPage dekaniWindow = new AdminPage(idPerdoruesi);
                 dekaniWindow.Show();
             }
             else
             {
                 //InsertSubstition isW = new InsertSubstition();
                 //isW.Show();
                 //AdminWindow aW = new AdminWindow(idPerdoruesi);
                 //aW.Show();
                 //AdminPage dekaniWindow = new AdminPage(idPerdoruesi);
                 //dekaniWindow.Show();
                 //RaportiWindow rW = new RaportiWindow();
                 //rW.Show();
             }
             this.Close();
         }
         else
         if (conn)
         {
             Error.Content = "Gabim në të dhëna";
         }
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idProf"></param>
        public EvidenceWindow(string idProf)
        {
            user_ID = idProf;
            eW      = this;
            p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            InitializeComponent();

            now = Methods.datetimeInMysql();
            string query = "SELECT * FROM devicereg";

            devices = Methods.getDevices(query);

            stopVirtualWifi();
            string cmbFirstItem         = "Zgjedhni Lenden...";
            string getProfSubjectsQuery = "SELECT s.subject_id, s.subject FROM cps c INNER JOIN subjects s ON s.subject_id=c.subject_id INNER JOIN users u ON u.user_id=c.user_id WHERE c.user_id='" + idProf + "'";

            //Methods.fillCombo(cmbSubjects, getProfSubjectsQuery, cmbFirstItem);
            sch = Methods.SubClosestToDate(user_ID);
            cmbSubjects.Items.Add(sch.subject);
            cmbLush.Items.Add(sch.lush);
            cmbGroups.Items.Add(sch.group);
        }