Exemplo n.º 1
0
        // Get a studios id by passing in a name
        public static int GetStudio(string studio)
        {
            string    sql  = SqlProcedures.GetStudio(studio);
            DataTable temp = Call(sql);

            if (temp.Rows.Count == 0)
            {
                sql = SqlProcedures.CreateStudio(studio);
                Run(sql, "Create Studio");
                sql  = SqlProcedures.GetStudio(studio);
                temp = Call(sql);
            }
            if (temp.Rows.Count > 0)
            {
                int id;
                int.TryParse(temp.Rows[0][0].ToString(), out id);
                return(id);
            }
            else
            {
                return(-1);
            }
        }