public static void WriteDynamicSearchSqlScript(Page page, SearchInfoSql searhInfo, string key, string functionName) { 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("../AppX/UserControls/UcButtonEditSql/DynamicSearchPageSql.aspx"); 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("wnd.set_centerIfModal(true);"); js.AppendLine(); } js.Append("return false;"); js.AppendLine(); js.AppendLine("}"); js.AppendLine("</script>"); ScriptManager.RegisterClientScriptBlock(page, page.GetType(), key, js.ToString(), false); //page.ClientScript.RegisterClientScriptBlock(); }
public static void ClearSearchCache(SearchInfoSql info) { HttpContext.Current.Session["$DynSearchSql_" + info.SessionKeyName] = null; }
public static DataRow GetSearchKeyValue(SearchInfoSql info) { return HttpContext.Current.Session["$DynSearchSql_" + info.SessionKeyName] as DataRow; }
public static void SetSearchKeyValue(SearchInfoSql info, DataRow row) { HttpContext.Current.Session["$DynSearchSql_" + info.SessionKeyName] = row; }
private SearchInfoSql CreateSearchInfo() { SearchInfoSql info = new SearchInfoSql(); info.SelectSql = this.SelectSql; info.ConnectionString = this.ConnectionString; info.PageTitle = "Arama Listesi"; info.Height = 600; info.Width = 1100; info.SessionKeyName = this.Key; return info; }