예제 #1
0
        public static SYSParams GetItemByAlias(SearchSYSParams dto)
        {
            var tabl = ConnectDb.ExecuteDataTableTask(Startup.ConnectionString, "SP_SYS_Params",
                                                      new string[] { "@flag", "@IdType", "@Alias" },
                                                      new object[] { "GetItemByAlias", dto.IdType, dto.Alias });

            return((from r in tabl.AsEnumerable()
                    select new SYSParams
            {
                Id = (int)r["Id"],
                Title = (string)((r["Title"] == System.DBNull.Value) ? "" : r["Title"]),
                Icon = (string)((r["Icon"] == System.DBNull.Value) ? "" : r["Icon"]),
                Introtext = (string)((r["Introtext"] == System.DBNull.Value) ? "" : r["Introtext"]),
                Alias = (string)((r["Alias"] == System.DBNull.Value) ? "" : r["Alias"]),
            }).FirstOrDefault());
        }
예제 #2
0
        public static List <SYSParams> GetListDestinationCat(SearchSYSParams dto)
        {
            int status = 0;

            if (dto.Selected)
            {
                status = 1;
            }
            var tabl = ConnectDb.ExecuteDataTableTask(Startup.ConnectionString, "SP_SYS_Params",
                                                      new string[] { "@flag", "@IdType", "@Selected" },
                                                      new object[] { "GetList", dto.IdType, status });

            return((from r in tabl.AsEnumerable()
                    select new SYSParams
            {
                Id = (int)r["Id"],
                Title = (string)((r["Title"] == System.DBNull.Value) ? "" : r["Title"]),
                Icon = (string)((r["Icon"] == System.DBNull.Value) ? "" : r["Icon"]),
                Introtext = (string)((r["Introtext"] == System.DBNull.Value) ? "" : r["Introtext"]),
                Alias = (string)((r["Alias"] == System.DBNull.Value) ? "" : r["Alias"])
            }).ToList());
        }
예제 #3
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);
        }