Exemple #1
0
 public IList <CODE_DATA> GetKeywordAutoCompleateList([FromBody] KEYWORD_COND Cond)
 {
     return(new KeywordService().GetKeywordKoreanList(Cond));
 }
 public JsonResult getKeywordAutoCompleate(KEYWORD_COND Cond)
 {
     return(new JsonResult {
         Data = new KeywordService().GetKeywordKoreanList(Cond)
     });
 }
 public PartialViewResult PV_KeywordAutoList(KEYWORD_COND Cond)
 {
     ViewBag.Cond = Cond;
     ViewBag.list = new KeywordService().GetKeywordKoreanList(Cond);
     return(PartialView());
 }
        /// <summary>
        /// 광고카테고리리스트가져오기
        /// </summary>
        /// <param name="Cond"></param>
        /// <returns></returns>
        public IList <CODE_DATA> GetKeywordKoreanList(KEYWORD_COND Cond)
        {
            Koreanunit.HANGUL_INFO data = Koreanunit.HangulJaso.DevideJaso(Cond.KEYWORD_NAME);

            int           nCnt            = 0;
            StringBuilder sbKoreanWansung = new StringBuilder();

            if (data.arrWansungs.Count() > 0)
            {
                sbKoreanWansung.Append("\n").Append("           AND (");
                for (int i = 0; i < data.arrWansungs.Count(); i++)
                {
                    if (i > 0)
                    {
                        sbKoreanWansung.Append("\n").Append("                   AND ");
                    }

                    sbKoreanWansung.Append("   KEYWORD_NAME LIKE N'%").Append(data.arrWansungs[i].ToString("")).Append("%'");
                }
                sbKoreanWansung.Append("\n").Append("             )");
            }


            if (data.arrChosung.Where(w => !string.IsNullOrEmpty(w)).Count() > 0)
            {
                Cond.CHOSUNG = "AND (";
                for (int i = 0; i < data.arrChosung.Count(); i++)
                {
                    if (!string.IsNullOrEmpty(data.arrChosung[i]))
                    {
                        if (nCnt > 0)
                        {
                            Cond.CHOSUNG += " AND ";
                        }
                        Cond.CHOSUNG += " CHOSUNG LIKE " + ((i > 0) ? "N'%" : "N'") + data.arrChosung[i].ToString("") + "%'";
                        nCnt++;
                    }
                }
                Cond.CHOSUNG += ") ";
            }
            nCnt = 0;
            if (data.arrJungung.Where(w => !string.IsNullOrEmpty(w)).Count() > 0)
            {
                Cond.JUNGSUNG = "AND (";
                for (int i = 0; i < data.arrJungung.Count(); i++)
                {
                    if (!string.IsNullOrEmpty(data.arrJungung[i]))
                    {
                        if (nCnt > 0)
                        {
                            Cond.JUNGSUNG += " AND ";
                        }
                        Cond.JUNGSUNG += " JUNGSUNG LIKE " + ((i > 0) ? "N'%" : "N'") + data.arrJungung[i].ToString("") + "%'";
                        nCnt++;
                    }
                }
                Cond.JUNGSUNG += ") ";
            }
            nCnt = 0;
            if (data.arrJongung.Where(w => !string.IsNullOrEmpty(w)).Count() > 0)
            {
                Cond.JONGSUNG = "AND (";
                for (int i = 0; i < data.arrJongung.Count(); i++)
                {
                    if (!string.IsNullOrEmpty(data.arrJongung[i]))
                    {
                        if (nCnt > 0)
                        {
                            Cond.JONGSUNG += " AND ";
                        }
                        Cond.JONGSUNG += " JONGSUNG LIKE " + ((i > 0) ? "N'%" : "N'") + data.arrJongung[i].ToString("") + "%'";
                        nCnt++;
                    }
                }
                Cond.JONGSUNG += ") ";
            }
            Cond.KEYWORD_UNITS = data.splitstring;
            string sql = Global.DBAgent.LoadSQL(sqlBasePath + "Advertising\\Keyword.xml", "GetKeywordKoreanList"
                                                , Cond.KEYWORD_NAME.ToString("")
                                                , Cond.KEYWORD_TYPE.ToString("")
                                                , sbKoreanWansung.ToString()
                                                , Cond.CHOSUNG
                                                , Cond.JUNGSUNG
                                                , Cond.JONGSUNG
                                                , Cond.KEYWORD_UNITS.ToString("").Trim()

                                                );


            return(db.ExecuteQuery <CODE_DATA>(sql).ToList());
        }