private SearchInfo CreateSearchInfo()
 {
     SearchInfo info = new SearchInfo();
     info.EntityType = typeof(Report_View);
     info.PageTitle = "Rapor Listesi";
     info.Height = 500;
     info.Width = 700;
     return info;
 }
示例#2
0
        private static void WriteDynamicSearchScript(Page page, SearchInfo searhInfo, string key, string functionName, string url)
        {
            if (null == page)
                throw new ArgumentNullException("page");
            if (String.IsNullOrEmpty(key))
                throw new ArgumentNullException("key");
            if (String.IsNullOrEmpty(functionName))
                throw new ArgumentNullException("functionName");
            if (null == searhInfo)
                throw new ArgumentNullException("searhInfo");

            StringBuilder js = new StringBuilder();
            js.Append("<script type='text/javascript'>");
            js.AppendLine();
            js.Append("function ");
            js.Append(functionName);
            js.Append("() {");
            js.AppendLine();
            js.Append("var wnd = radopen('..");
            js.Append(url);
            js.Append("?S=");

            //js.Append(searhInfo.BinarySerialize());
            js.Append(Utility.ToQueryString(searhInfo));

            js.Append("', 'RadWindow1');");
            js.AppendLine();
            js.Append("wnd.set_title('");
            js.Append(searhInfo.PageTitle);
            js.Append("');");
            js.AppendLine();

            if (searhInfo.Maximize)
            {
                js.Append("wnd.maximize();");
                js.AppendLine();
            }
            else
            {
                js.Append("wnd.setSize(");
                js.Append(searhInfo.Width);
                js.Append(", ");
                js.Append(searhInfo.Height);
                js.Append(");");
                js.AppendLine();
                js.Append("wnd.center();");
                js.AppendLine();
                js.Append("wnd.set_modal(true);");
                js.AppendLine();
            }
            js.Append("return false;");
            js.AppendLine();
            js.AppendLine("}");
            js.AppendLine("</script>");

            page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, js.ToString());
        }
        private static IList<PropertyInfo> GetVisibleProperties(SearchInfo info)
        {
            List<PropertyInfo> list = new List<PropertyInfo>();
            PropertyInfo[] props = info.EntityType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            for (int j = 0; j < props.Length; ++j)
            {
                PropertyInfo pi = props[j];

                if (pi.NotMapped()) continue;

                KeyAttribute keyAtt = pi.GetCustomAttribute<KeyAttribute>();
                if (null != keyAtt) continue;

                AutoGeneratedAttribute att = pi.GetCustomAttribute<AutoGeneratedAttribute>();
                if (null != att && !att.Visible) continue;

                list.Add(pi);
            }

            return list;
        }
 private SearchInfo CreateSearchInfo()
 {
     SearchInfo info = new SearchInfo();
     info.EntityType = this.EntityType;
     info.PageTitle = "Arama Listesi";
     info.Height = 600;
     info.Width = 1000;
     info.SessionKeyName = this.Key;
     return info;
 }
示例#5
0
 public static void WriteDynamicSearchScript(Page page, SearchInfo searhInfo, string key, string functionName)
 {
     WriteDynamicSearchScript(page, searhInfo, key, functionName, "/AppX/Utility/DynamicSearch/DynamicSearchPage.aspx");
 }
 public static void ClearSearchCache(SearchInfo info)
 {
     HttpContext.Current.Session["$DynSearch_" + info.SessionKeyName] = null;
 }
 public static void SetSearchEventArgs(SearchInfo info, SearchEventArgs e)
 {
     HttpContext.Current.Session["$DynSearch_" + info.SessionKeyName] = e;
 }
 public static SearchEventArgs GetSearchEventArgs(SearchInfo info)
 {
     return HttpContext.Current.Session["$DynSearch_" + info.SessionKeyName] as SearchEventArgs;
 }