Exemplo n.º 1
0
        public static SYSConfig GetItemConfigByHome()
        {
            //var SiteConfig = HttpContext.Session.GetString("SiteConfig");
            SYSConfig Item = SYSParamsService.GetItemConfig();

            return(Item);
        }
Exemplo n.º 2
0
        public static SYSConfig GetItemConfig()
        {
            SearchSYSParams dto = new SearchSYSParams()
            {
                IdType = "IdConfig"
            };
            List <SYSParams>            listCauHinh        = SYSParamsService.GetList(dto);
            SYSConfig                   itemCauHinhHeThong = new SYSConfig();
            Dictionary <string, string> dAttributes        = new Dictionary <string, string>();

            for (int k = 0; k < listCauHinh.Count(); k++)
            {
                string type  = listCauHinh[k].Title;
                string value = listCauHinh[k].Introtext;
                dAttributes.Add(type, value);
            }
            itemCauHinhHeThong.Email              = dAttributes["Email"];
            itemCauHinhHeThong.WebsiteName        = dAttributes["WebsiteName"];
            itemCauHinhHeThong.CompanyName        = dAttributes["CompanyName"];
            itemCauHinhHeThong.Slogan             = dAttributes["Slogan"];
            itemCauHinhHeThong.Phone              = dAttributes["Phone"];
            itemCauHinhHeThong.Facebook           = dAttributes["Facebook"];
            itemCauHinhHeThong.Twitter            = dAttributes["Twitter"];
            itemCauHinhHeThong.Footer             = dAttributes["Footer"];
            itemCauHinhHeThong.SEODescription     = dAttributes["SEODescription"];
            itemCauHinhHeThong.SEOKeyword         = dAttributes["SEOKeyword"];
            itemCauHinhHeThong.Contact            = dAttributes["Contact"];
            itemCauHinhHeThong.Map                = dAttributes["Map"];
            itemCauHinhHeThong.Youtube            = dAttributes["Youtube"];
            itemCauHinhHeThong.Address            = dAttributes["Address"];
            itemCauHinhHeThong.CountYTST          = dAttributes["CountYTST"];
            itemCauHinhHeThong.Hotline            = dAttributes["Hotline"];
            itemCauHinhHeThong.TaiSao             = dAttributes["TaiSao"];
            itemCauHinhHeThong.LuotKham           = dAttributes["LuotKham"];
            itemCauHinhHeThong.BenhNhanHaiLong    = dAttributes["BenhNhanHaiLong"];
            itemCauHinhHeThong.PhauThuatThanhCong = dAttributes["PhauThuatThanhCong"];
            return(itemCauHinhHeThong);
        }
Exemplo n.º 3
0
        public static void SaveConfig(SYSConfig dto)
        {
            Dictionary <string, string> dAttributes = new Dictionary <string, string>()
            {
                { "Email", dto.Email },
                { "WebsiteName", dto.WebsiteName },
                { "CompanyName", dto.CompanyName },
                { "Slogan", dto.Slogan },
                { "Phone", dto.Phone },
                { "Facebook", dto.Facebook },
                { "Youtube", dto.Youtube },
                { "Twitter", dto.Twitter },
                { "SEODescription", dto.SEODescription },
                { "SEOKeyword", dto.SEOKeyword },
                { "Map", dto.Map },
                { "Contact", dto.Contact },
                { "Address", dto.Address },
                { "Footer", dto.Footer },
                { "Hotline", dto.Hotline },
                { "TaiSao", dto.TaiSao },
                { "LuotKham", dto.LuotKham },
                { "BenhNhanHaiLong", dto.BenhNhanHaiLong },
                { "PhauThuatThanhCong", dto.PhauThuatThanhCong }
            };


            foreach (var item in dAttributes)
            {
                SYSParams param = new SYSParams()
                {
                    Title = item.Key, Introtext = item.Value
                };
                var tabl = ConnectDb.ExecuteDataTableTask(Startup.ConnectionString, "SP_SYS_Params",
                                                          new string[] { "@flag", "@Title", "@Introtext" },
                                                          new object[] { "SaveConfig", param.Title, param.Introtext });
            }
        }