sp_add_lampgroup() public method

public sp_add_lampgroup ( string name, byte password, string group_name ) : int
name string
password byte
group_name string
return int
Ejemplo n.º 1
0
        /// <summary>
        /// PSP 4.1
        /// Lampegruppe hinzufuegen
        /// </summary>
        /// <param name="username">Username</param>
        /// <param name="password">Passwort</param>
        /// <param name="lampGroupName">Name der neuen Lampengruppe</param>
        /// <returns>success -> ob erfolgreich oder nicht</returns>
        public static bool addLampGroup(string username, string password, string lampGroupName)
        {
            bool success = false;
            //Übergebenes Passwort hashen und in Var pwhash speichern für die Übergabe an DB
            Byte[] pwhash = HelperClass.GetHash(password);

            using (itin18_aktEntities cont = new itin18_aktEntities())
            {                             
                try
                {
                    //Lampengruppe erstellen                     
                    cont.sp_add_lampgroup(username, pwhash, lampGroupName);                          
                    success = true;
                }
                catch (Exception e)
                {
                    success = false;
                }
            }

            return success;
        }