예제 #1
0
 public DatenbankArgs getKlasse(string Email)
 {
     try
     {
         DatenbankArgs user = getby(Email, "S_Email");
         if (user.Success == false)
         {
             throw new Exception(user.Error);
         }
         return(new klasse().getNameByID((int)user.Data.Rows[0]["Kl_ID"]));
     }
     catch (Exception ex)
     {
         return(new DatenbankArgs(ex.Message));
     }
 }
예제 #2
0
            public DatenbankArgs login(string Email, string Passwort)
            {
                try
                {
                    DatenbankArgs user = getby(Email, "L_Email");
                    if (user.Success == false)
                    {
                        throw new Exception(user.Error);
                    }

                    if ((string)(user.Data.Rows[0]["L_Passwort"]) == Passwort)
                    {
                        return(new DatenbankArgs(user.Data));
                    }

                    throw new Exception("Passwort Falsch");
                }
                catch (Exception ex)
                {
                    return(new DatenbankArgs(ex.Message));
                }
            }
예제 #3
0
            public DatenbankArgs updateKurse(int S_ID, List <string> K_IDS)
            {
                try
                {
                    vta.DeleteSchülerKurse(S_ID);
                    foreach (string K_ID in K_IDS)
                    {
                        vta.Insert(S_ID, Convert.ToInt16(K_ID));
                    }
                    DatenbankArgs data = getKurse(S_ID);
                    if (data.Success)
                    {
                        return(new DatenbankArgs(data.Data));
                    }

                    return(data);
                }
                catch (Exception ex)
                {
                    return(new DatenbankArgs(ex.Message));
                }
            }