Exemple #1
0
        // GET: Home
        public ActionResult Index()
        {
            string Latitude  = Session["ULatitude"] != null ? Session["ULatitude"].ToString() : "0";
            string Longitude = Session["ULongitude"] != null ? Session["ULongitude"].ToString() : "0";

            List <MetaDataViewModel> MetaData = new List <MetaDataViewModel> {
                new MetaDataViewModel {
                    name = "description", content = "MusicEvent is great place to browse any music event anywhere in world. You can search all recent music events, programs, concert by well know celebrities, musicians, singers using our easy search options. you can also book for events, programs, concert easy steps."
                },
                new MetaDataViewModel {
                    name = "keywords", content = "MusicEvent, Music, Program, Concert, Party, Singer, Celebrities, Musician, Singer, USA"
                }
            };

            ViewBag.MetaData = MetaData;

            List <EventDataModal> EventsData = _EventService.GetTenLatestEvents(0, "", null, Latitude, Longitude);
            List <EventViewModal> Events     = Mapper.Map <List <EventDataModal>, List <EventViewModal> >(EventsData);

            EventDataModal HeaderEvent = _EventService.GetHeaderEvent(Latitude, Longitude);

            ViewBag.HeaderEvent      = Mapper.Map <EventDataModal, EventViewModal>(HeaderEvent);
            ViewBag.MainCategoryList = GlobalDataHelper.GetMainCategoryList();

            return(View(Events));
        }
        private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
        {
            if (e.OriginalSource is Button button && button.Tag is string tag)
            {
                PopupConfig.IsOpen = false;
                if (tag.Equals(GlobalDataHelper <AppConfig> .Config.Lang))
                {
                    return;
                }

                Growl.Ask(Lang.ResourceManager.GetString("ChangeLanguage"), b =>
                {
                    if (!b)
                    {
                        return(true);
                    }

                    GlobalDataHelper <AppConfig> .Config.Lang = tag;
                    GlobalDataHelper <AppConfig> .Save();
                    LocalizationManager.Instance.CurrentCulture = new System.Globalization.CultureInfo(tag);
                    ConfigHelper.Instance.SetLang(GlobalDataHelper <AppConfig> .Config.Lang);
                    return(true);
                });
            }
        }
 /// <summary>
 /// 解密数据
 /// </summary>
 /// <returns>The data.</returns>
 /// <param name="dataToDecrypt">Data to decrypt.</param>
 public string DecryptData(string dataToDecrypt)
 {
     //给密文解密用FromBase64String
     byte[] dataToDecryptArray = Convert.FromBase64String(dataToDecrypt);
     byte[] dataAfterDecryptArray = GlobalDataHelper.DataEncryptAlgorithm().CreateDecryptor()
     .TransformFinalBlock(dataToDecryptArray, 0, dataToDecryptArray.Length);
     return Encoding.UTF8.GetString(dataAfterDecryptArray);
 }
 /// <summary>
 /// 加密数据
 /// </summary>
 /// <returns>The data.</returns>
 /// <param name="dataToEncrypt">Data to encrypt.</param>
 public string EncryptData(string dataToEncrypt)
 {
     //给明文加密用GetBytes
     byte[] dataToEncryptArray = Encoding.UTF8.GetBytes(dataToEncrypt);
     byte[] dataAfterEncryptArray = GlobalDataHelper.DataEncryptAlgorithm().CreateEncryptor()
     .TransformFinalBlock(dataToEncryptArray, 0, dataToEncryptArray.Length);
     return Convert.ToBase64String(dataAfterEncryptArray, 0, dataAfterEncryptArray.Length);
 }
Exemple #5
0
        public App()
        {
            AppCenter.Start("0153dc1d-eda3-4da2-98c9-ce29361d622d",
                            typeof(Analytics), typeof(Crashes));

            GlobalDataHelper <AppConfig> .Init($"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json");

            LocalizationManager.Instance.LocalizationProvider = new ResxProvider();
            LocalizationManager.Instance.CurrentCulture       = new System.Globalization.CultureInfo(GlobalDataHelper <AppConfig> .Config.Lang);
        }
Exemple #6
0
 public static void WriteApiConfiguration(string tmdbkey, string igdbClientId, string igdbClientSecret,
                                          string dartClientSecret, string dartId)
 {
     GlobalDataHelper <AppConfig> .Config.TmdbKey          = tmdbkey;
     GlobalDataHelper <AppConfig> .Config.IgdbClientId     = igdbClientId;
     GlobalDataHelper <AppConfig> .Config.IgdbClientSecret = igdbClientSecret;
     GlobalDataHelper <AppConfig> .Config.DevClientId      = dartId;
     GlobalDataHelper <AppConfig> .Config.DevClientSecret  = dartClientSecret;
     GlobalDataHelper <AppConfig> .Save();
 }
 //public static void SaveProperties() => File.WriteAllText("ImageConverter.json", JsonSerializer.Serialize(GetPropertiesModel));
 public static void SaveProperties(PropertiesModel propertiesModel)
 {
     GlobalDataHelper <PropertiesModel> .Config.DeleteImage     = propertiesModel.DeleteImage;
     GlobalDataHelper <PropertiesModel> .Config.PlaySound       = propertiesModel.PlaySound;
     GlobalDataHelper <PropertiesModel> .Config.SoundToPlay     = propertiesModel.SoundToPlay;
     GlobalDataHelper <PropertiesModel> .Config.WebPEmulateJpeg = propertiesModel.WebPEmulateJpeg;
     GlobalDataHelper <PropertiesModel> .Config.WebPLosses      = propertiesModel.WebPLosses;
     GlobalDataHelper <PropertiesModel> .Config.WebPQuality     = propertiesModel.WebPQuality;
     GlobalDataHelper <PropertiesModel> .Config.WebPRemoveAlpha = propertiesModel.WebPRemoveAlpha;
     GlobalDataHelper <PropertiesModel> .Save();
 }
Exemple #8
0
        public App()
        {
            GlobalDataHelper <AppConfig> .Init($"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json");

            LocalizationManager.Instance.LocalizationProvider = new ResxProvider();
            LocalizationManager.Instance.CurrentCulture       = new System.Globalization.CultureInfo(GlobalDataHelper <AppConfig> .Config.UILang);


            //init Appcenter Crash Reporter
            AppCenter.Start("3770b372-60d5-49a1-8340-36a13ae5fb71",
                            typeof(Analytics), typeof(Crashes));
            AppCenter.Start("3770b372-60d5-49a1-8340-36a13ae5fb71",
                            typeof(Analytics), typeof(Crashes));
        }
Exemple #9
0
        private void ToggleSkins_OnClick(object sender, RoutedEventArgs e)
        {
            var tag = SkinType.Default;

            tag = tg.IsChecked.Value ? SkinType.Dark : SkinType.Default;

            if (tag.Equals(GlobalDataHelper <AppConfig> .Config.Skin))
            {
                return;
            }

            GlobalDataHelper <AppConfig> .Config.Skin = tag;
            GlobalDataHelper <AppConfig> .Save();

            ((App)Application.Current).UpdateSkin(tag);
        }
        private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
        {
            if (e.OriginalSource is Button button && button.Tag is SkinType tag)
            {
                PopupConfig.IsOpen = false;
                if (tag.Equals(GlobalDataHelper <AppConfig> .Config.Skin))
                {
                    return;
                }

                GlobalDataHelper <AppConfig> .Config.Skin = tag;
                GlobalDataHelper <AppConfig> .Save();

                ((App)System.Windows.Application.Current).UpdateSkin(tag);
            }
        }
        // GET: Event
        public ActionResult Index()
        {
            List <MetaDataViewModel> MetaData = new List <MetaDataViewModel> {
                new MetaDataViewModel {
                    name = "description", content = "List of MusicEvents. MusicEvent is great place to browse any music event anywhere in world. You can search all recent music events, programs, concert by well know celebrities, musicians, singers using our easy search options. you can also book for events, programs, concert easy steps."
                },
                new MetaDataViewModel {
                    name = "keywords", content = "MusicEvent, Music, Program, Concert, Party, Singer, Celebrities, Musician, Singer, USA"
                }
            };

            ViewBag.MetaData = MetaData;

            ViewBag.MainCategoryList = GlobalDataHelper.GetMainCategoryList();

            return(View());
        }
Exemple #12
0
 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     if (GlobalDataHelper <AppConfig> .Config.IsShowNotifyIcon)
     {
         if (GlobalDataHelper <AppConfig> .Config.IsFirstRun)
         {
             MessageBoxResult result = HandyControl.Controls.MessageBox.Show(new MessageBoxInfo
             {
                 Message      = Lang.ResourceManager.GetString("RunInBackgroundMainWindow"),
                 Caption      = Lang.ResourceManager.GetString("Title"),
                 Button       = MessageBoxButton.YesNo,
                 IconBrushKey = ResourceToken.AccentBrush,
                 IconKey      = ResourceToken.InfoGeometry
             });
             if (result == MessageBoxResult.Yes)
             {
                 Hide();
                 e.Cancel = true;
                 GlobalDataHelper <AppConfig> .Config.IsFirstRun = false;
                 GlobalDataHelper <AppConfig> .Save();
             }
             else
             {
                 base.OnClosing(e);
             }
         }
         else
         {
             Hide();
             e.Cancel = true;
         }
     }
     else
     {
         base.OnClosing(e);
     }
 }
Exemple #13
0
 public App()
 {
     GlobalDataHelper.Load <AppConfig>();
 }
Exemple #14
0
 public App()
 {
     GlobalDataHelper <AppConfig> .Init();
 }