Exemplo n.º 1
0
        // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        // checks in user's directory for any local style defn
        // if not present, checks in app config table for style defn
        // if not present, uses Support Default sytle (which must be present, otherwise no styling can (will) be applied)
        public string GetCssGeneralDirectory(MySqlConnection con, string unm, string dnm)
        {
            string s = GetCurrentStyleForAUser(con, unm, dnm);

            if (s.Length > 0)
            {
                if (s.StartsWith("Zara", StringComparison.CurrentCultureIgnoreCase))
                {
                    return("/Zara/Support/Css/" + s + "/");
                }

                if (StyleExists(s, dnm)) // in case style has been deleted after user selected it
                {
                    return("/Zara/" + dnm + "/Css/" + generalUtils.Capitalize(s) + "/");
                }
            }

            try
            {
                string[] companyName             = new string[1];
                string[] applicationStartDate    = new string[1];
                string[] financialYearStartMonth = new string[1];
                string[] financialYearEndMonth   = new string[1];
                string[] effectiveStartDate      = new string[1];
                string[] companyPhone            = new string[1];
                string[] companyFax    = new string[1];
                string[] dateStyle     = new string[1];
                string[] dateSeparator = new string[1];
                string[] description   = new string[1];
                string[] companyEMail  = new string[1];
                string[] terseName     = new string[1];
                string[] latitude      = new string[1];
                string[] longitude     = new string[1];
                string[] googleMapsKey = new string[1];
                string[] currentStyle  = new string[1];

                definitionTables.GetAppConfig(con, dnm, companyName, applicationStartDate, financialYearStartMonth, financialYearEndMonth, effectiveStartDate, companyPhone, companyFax, dateStyle,
                                              dateSeparator, description, companyEMail, terseName, latitude, longitude, googleMapsKey, currentStyle);

                return(currentStyle[0].StartsWith("Zara", StringComparison.CurrentCultureIgnoreCase)
                    ? "/Zara/Support/Css/" + currentStyle[0] + "/"
                    : "/Zara/" + dnm + "/Css/" + currentStyle[0] + "/");
            }
            catch (Exception e)
            {
                Console.WriteLine("GetCssGeneralDirectory: " + e);

                return("/Zara/Support/Css/Default/");
            }
        }