Beispiel #1
0
        public List <vw_ContentsViewAll> Sel_Ext_ByKeyCodeCategoryLevel1(string Key, bool Disable)
        {
            try
            {
                ConfigsBO        aConfigsBO        = new ConfigsBO();
                CategoryLevel1BO aCategoryLevel1BO = new CategoryLevel1BO();

                // string Code = aConfigsBO.Sel_ByAccessKey(Key).Value;

                // return this.aDatabaseDA.vw_ContentsViewAll.Where(p => p.CategoryLevel1_Code == Code).Where(p => p.Contents_Disable == Disable).ToList();

                List <Configs> ListConfigs = aConfigsBO.Sel_ByAccessKey(Key);
                List <string>  ListCode    = new List <string>();

                for (int i = 0; i < ListConfigs.Count; i++)
                {
                    ListCode.Add(ListConfigs[i].Value.ToString());
                }

                string ListCodeTempt = String.Join(",", ListCode);
                //return this.aDatabaseDA.vw_CategoryLevel1ViewAll.Where(p => p.CategoryLevel1_Code.Contains(ListCodeTempt)).Where(p => p.CategoryLevel1_CategoryLevel2_IDLang == IDLang).ToList();
                return(this.aDatabaseDA.vw_ContentsViewAll.Where(p => ListCodeTempt.Contains(p.Contents_Code)).Where(p => p.Contents_Disable == Disable).ToList());
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("ContentsBO.Sel_ByKeyCodeCategoryLevel1_ByIDLang: {0}", ex.Message));
            }
        }
Beispiel #2
0
        public List <vw_FilesViewAll> Sel_Ext_ByKeyCodeAlbums(string Key)
        {
            try
            {
                ConfigsBO aConfigsBO = new ConfigsBO();

                List <Configs> ListConfig = aConfigsBO.Sel_ByAccessKey(Key);
                List <string>  ListCode   = new List <string>();
                for (int i = 0; i < ListConfig.Count; i++)
                {
                    ListCode.Add(ListConfig[i].Value.ToString());
                }
                string ListCodeTempt = String.Join(",", ListCode);

                return(this.aDatabaseDA.vw_FilesViewAll.Where(p => p.Files_Code.Contains(ListCodeTempt)).ToList());
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("ContentsBO.SelectContents_ByCode_002: {0}", ex.Message));
            }
        }
        //===================================================================================================
        public List<vw_CategoryLevel2ViewAll> Sel_ByKeyCodeCategoryLevel2_ByIDLang(string Key, int IDLang, bool Disable)
        {
            try
            {
                ConfigsBO aConfigsBO = new ConfigsBO();
                CategoryLevel2BO aCategoryLevel2BO = new CategoryLevel2BO();

                // string Code = aConfigsBO.Sel_ByAccessKey(Key).Value;

                // return this.aDatabaseDA.vw_CategoryLevel2ViewAll.Where(p => p.Code == Code).Where(p => p.IDLang == IDLang).Where(p => p.Disable == Disable).ToList();

                List<Configs> ListConfigs = aConfigsBO.Sel_ByAccessKey(Key);
                List<string> ListCode = new List<string>();

                for (int i = 0; i < ListConfigs.Count; i++)
                {
                    ListCode.Add(ListConfigs[i].Value.ToString());
                }

                string ListCodeTempt = String.Join(",", ListCode);

                return this.aDatabaseDA.vw_CategoryLevel2ViewAll.Where(p => ListCodeTempt.Contains(p.Code)).Where(p => p.IDLang == IDLang).Where(p => p.Disable == Disable).ToList();

            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("CategoryLevel2BO.SelectCategoryLevel2_ByCode_002: {0}", ex.Message));
            }
        }
Beispiel #4
0
        public static string Load_DynamicDataLanguage_Page(HttpContext Context, string SYSTEM)
        {
            string PageHTML = Context.Request["filename"].ToString();
            LanguagesBO aLanguagesBO = new LanguagesBO();

            ConfigsBO aConfigsBO = new ConfigsBO();
            List<Configs> ListConfigsCMS = new List<Configs>();
            List<string> ListCodeCMS = new List<string>();
            ListConfigsCMS = aConfigsBO.Sel_ByAccessKey(key_DEF_LANG_CMS);
            for (int i = 0; i < ListConfigsCMS.Count; i++)
            {
                ListCodeCMS.Add(ListConfigsCMS[i].Value.ToString());
            }
            string ListCodeTemptCMS = String.Join(",", ListCodeCMS);
            List<Configs> ListConfigsWEB = new List<Configs>();
            List<string> ListCodeWEB = new List<string>();
            ListConfigsWEB = aConfigsBO.Sel_ByAccessKey(key_DEF_LANG_WEB);
            for (int i = 0; i < ListConfigsCMS.Count; i++)
            {
                ListCodeWEB.Add(ListConfigsWEB[i].Value.ToString());
            }
            string ListCodeTemptWEB = String.Join(",", ListCodeWEB);

            sys_NUM_LANG = aLanguagesBO.Sel().ToList().Count;

            if (SYSTEM == "CMS")
            {
                sys_DEF_LANG = int.Parse(ListCodeTemptCMS);
            }
            else if (SYSTEM == "WEB")
            {
                sys_DEF_LANG = int.Parse(ListCodeTemptWEB);
            }

            if (!string.IsNullOrEmpty(Context.Request.QueryString["IDLang"]))
            {
                sys_CUR_LANG = Convert.ToInt32(Context.Request.QueryString["IDLang"]);
            }
            else
            {
                if (Context.GetSection(key_CUR_LANG) != null)
                {
                    sys_CUR_LANG = Convert.ToInt32(Context.GetSection(key_CUR_LANG).ToString());
                }
                // Cuoi cung moi lay den ngon ngu mac dinh
                else
                {
                    sys_CUR_LANG = int.Parse(ListCodeTemptCMS);
                }

            }

            string PhysicalPath = Context.Server.MapPath(@"\\Languages\\" + aLanguagesBO.Sel_ByID(sys_CUR_LANG).NameLang + "\\" + PageHTML + ".xml");
            XmlDocument doc = new XmlDocument();
            doc.Load(PhysicalPath);

            XmlElement element = doc.DocumentElement;
            XmlNodeList attr_coll = doc.SelectNodes("//item");

            List<LanguagesItem> List_ItemLang = new List<LanguagesItem>();

            LanguagesItem Item;
            foreach (XmlNode node in attr_coll)
            {
                Item = new LanguagesItem();
                Item.Text = node.InnerText;
                Item.Key = node.Attributes["Index"].Value;

                List_ItemLang.Add(Item);
            }

            String jSonString = "";

            InfoLang aInfoLang = new InfoLang();
            aInfoLang.DATA_LANG = List_ItemLang;
            aInfoLang.sys_CUR_LANG = sys_CUR_LANG;
            aInfoLang.sys_DEF_LANG = sys_DEF_LANG;
            aInfoLang.sys_NUM_LANG = sys_NUM_LANG;

            _converter.DateTimeFormat = "dd/MM/yyyy";

            jSonString = JsonConvert.SerializeObject(aInfoLang, _converter);

            CORE_Language.aInfoLang.DATA_LANG = List_ItemLang;  // Chỗ chứa dữ liệu cho cách thức truy cập từ trang aspx
            return jSonString;
        }
Beispiel #5
0
        //
        //-------- Danh cho phuong phap lay ngon ngu moi -------------
        public static void Load_Language(string SYSTEM)
        {
            LanguagesBO aLanguagesBO = new LanguagesBO();
            ConfigsBO aConfigsBO = new ConfigsBO();
            List<Configs> ListConfigsCMS = new List<Configs>();
            List<string> ListCodeCMS = new List<string>();
            ListConfigsCMS = aConfigsBO.Sel_ByAccessKey(key_DEF_LANG_CMS);
            for (int i = 0; i < ListConfigsCMS.Count; i++)
            {
                ListCodeCMS.Add(ListConfigsCMS[i].Value.ToString());
            }
            string ListCodeTemptCMS = String.Join(",", ListCodeCMS);
            List<Configs> ListConfigsWEB = new List<Configs>();
            List<string> ListCodeWEB = new List<string>();
            ListConfigsWEB = aConfigsBO.Sel_ByAccessKey(key_DEF_LANG_WEB);
            for (int i = 0; i < ListConfigsCMS.Count; i++)
            {
                ListCodeWEB.Add(ListConfigsWEB[i].Value.ToString());
            }
            string ListCodeTemptWEB = String.Join(",", ListCodeWEB);
            sys_NUM_LANG = aLanguagesBO.Sel().ToList().Count;

            if (SYSTEM == "CMS")
            {
                sys_DEF_LANG = int.Parse(ListCodeTemptCMS);
                sys_CUR_LANG = int.Parse(ListCodeTemptCMS);
            }
            else if (SYSTEM == "WEB")
            {
                sys_DEF_LANG = int.Parse(ListCodeTemptWEB);
                sys_CUR_LANG = int.Parse(ListCodeTemptWEB);
            }
        }
Beispiel #6
0
        public List<vw_FilesViewAll> Sel_Ext_ByKeyCodeFiles_ByIDLang(string Key, int IDLang, bool Disable)
        {
            try
             {
                 ConfigsBO aConfigsBO = new ConfigsBO();

                 List<Configs> ListConfig = aConfigsBO.Sel_ByAccessKey(Key);
                 List<string> ListCode = new List<string>();
                 for (int i = 0; i < ListConfig.Count; i++)
                 {
                     ListCode.Add(ListConfig[i].Value.ToString());
                 }
                 string ListCodeTempt = String.Join(",", ListCode);

                 return this.aDatabaseDA.vw_FilesViewAll.Where(p => p.Files_Code.Contains(ListCodeTempt)).Where(p => p.Files_IDLang == IDLang).Where(p=>p.Files_Disable==Disable).ToList();

             }
             catch (Exception ex)
             {
                 throw new Exception(String.Format("ContentsBO.SelectContents_ByCode_002: {0}", ex.Message));
             }
        }
Beispiel #7
0
        public List<vw_ContentsViewAll> Sel_Ext_ByKeyCodeContents_ByIDLang(string Key, int IDLang, bool Disable)
        {
            try
            {
                ConfigsBO aConfigsBO = new ConfigsBO();
                CategoryLevel1BO aCategoryLevel1BO = new CategoryLevel1BO();

                string Code = aConfigsBO.Sel_ByAccessKey(Key).Value;

                return this.aDatabaseDA.vw_ContentsViewAll.Where(p => p.Contents_Code == Code).Where(p => p.Contents_CategoryLevel1_IDLang == IDLang).Where(p => p.Contents_Disable == Disable).ToList();

            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("ContentsBO.SelectContents_ByCode_002: {0}", ex.Message));
            }
        }
Beispiel #8
0
        public List<vw_ContentsViewAll> Sel_Ext_ByKeyCodeCategoryLevel1(string Key)
        {
            try
            {
                ConfigsBO aConfigsBO = new ConfigsBO();
                CategoryLevel1BO aCategoryLevel1BO = new CategoryLevel1BO();

                string Code = aConfigsBO.Sel_ByAccessKey(Key).Value;

                return this.aDatabaseDA.vw_ContentsViewAll.Where(p => p.CategoryLevel1_Code == Code).ToList();

            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("ContentsBO.Sel_ByKeyCodeCategoryLevel1_ByIDLang: {0}", ex.Message));
            }
        }
Beispiel #9
0
        private void Sel_ByAccessKey(HttpContext context)
        {
            string jSonString = string.Empty;
            ConfigsBO configsBO = new ConfigsBO();
            string accessKey = context.Request.QueryString["AccessKey"];
            bool disable = !String.IsNullOrEmpty(Convert.ToString(context.Request.QueryString["Disable"]))
                ? Convert.ToBoolean(context.Request.QueryString["Disable"])
                : false;
            List<Configs> listConfigs = String.IsNullOrEmpty(Convert.ToString(context.Request.QueryString["Disable"]))
                ? configsBO.Sel_ByAccessKey(accessKey)
                : configsBO.Sel_ByAccessKey(accessKey, disable);
            if (listConfigs.Any()) {
                _converter.DateTimeFormat = "dd/MM/yyyy";
                jSonString = JsonConvert.SerializeObject(listConfigs, _converter);
            }
            jSonString = "{\"data\":" + jSonString + "}";

            context.Response.Write(jSonString);
        }
Beispiel #10
0
        //KhoiDT select content by code cat 1
        //=============================================================================================
        public List<vw_ContentsViewAll> Sel_Ext_ByKeyCodeCategoryLevel1_ByIDLang(string Key, int IDLang)
        {
            try
            {
                ConfigsBO aConfigsBO = new ConfigsBO();
                CategoryLevel1BO aCategoryLevel1BO = new CategoryLevel1BO();

                List<Configs> ListConfigs = aConfigsBO.Sel_ByAccessKey(Key);
                List<string> ListCode = new List<string>();

                for (int i = 0; i < ListConfigs.Count; i++)
                {
                    ListCode.Add(ListConfigs[i].Value.ToString());
                }

                string ListCodeTempt = String.Join(",", ListCode);
                //return this.aDatabaseDA.vw_CategoryLevel1ViewAll.Where(p => p.CategoryLevel1_Code.Contains(ListCodeTempt)).Where(p => p.CategoryLevel1_CategoryLevel2_IDLang == IDLang).ToList();
                return this.aDatabaseDA.vw_ContentsViewAll.Where(p => ListCodeTempt.Contains(p.CategoryLevel1_Code)).Where(p => p.Contents_CategoryLevel1_IDLang == IDLang).ToList();
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("ContentsBO.Sel_ByKeyCodeCategoryLevel1_ByIDLang: {0}", ex.Message));
            }
        }