Beispiel #1
0
        private MagicsModel GetMagics()
        {
            var viewDataMagics = (MagicsModel)ViewData["Magics"];

            if (viewDataMagics == null)
            {
                viewDataMagics = new MagicsModel();

                if (viewDataMagics.Notifies == null)
                {
                    viewDataMagics.Notifies = new List <MagicAlertNotifyModel>();
                }

                if (viewDataMagics.ResetForms == null)
                {
                    viewDataMagics.ResetForms = new List <MagicResetFormModel>();
                }

                if (viewDataMagics.KendoRefresh == null)
                {
                    viewDataMagics.KendoRefresh = new List <MagicKendoRefreshModel>();
                }

                if (viewDataMagics.KendoWindowHandler == null)
                {
                    viewDataMagics.KendoWindowHandler = new List <MagicKendoWindowHandlerModel>();
                }
            }

            return(viewDataMagics);
        }
Beispiel #2
0
        private void SetMagics(MagicsModel magics)
        {
            ViewData["Magics"] = magics;

            HttpContext.Response.Cookies.Append("Magics", JsonConvert.SerializeObject(magics));
        }