示例#1
0
        private string CreateWherePart(BCHControls.UCAddToListBox atl, string field)
        {
            string wherePart = string.Empty;

            if (atl.SelectedCount < 1)
            {
                return(wherePart);
            }

            List <string> list = atl.GetSelectedItems();

            if (atl.SelectedCount == 1 && list[0] == "None")
            {
                return(wherePart);
            }

            wherePart = MP3DBManager.BuildSearchWhereClausePart(field, list, true, rbAnd.Checked, cbxUseLike.Checked);

            return(wherePart);
        }
示例#2
0
        private string CreateWherePart(BCHControls.UCFromTo atl, string field)
        {
            string        wherePart = string.Empty;
            List <string> list      = atl.GetStrList(BCHControls.UCFromToEnum.To);

            if (!list.Any())
            {
                return(wherePart);
            }

            List <string> listFixed = new List <string>();

            //make sure to escape sinqle quotes for query
            foreach (var item in list)
            {
                listFixed.Add(item.Replace("'", "''"));
            }

            wherePart = MP3DBManager.BuildSearchWhereClausePart(field, listFixed, true, rbAnd.Checked, cbxUseLike.Checked);

            return(wherePart);
        }