private void Wizards() { if (useAJAX) { string txt = ""; Smarty.Table tableInfo = null; Smarty.Field fieldInfo = null; List <Smarty.LookupField> lookups = null; if (inlineedit) { linkdata = linkdata.Replace("&", "&").Replace("<", "<").Replace(">", ">"); smarty.Add("linkdata", linkdata); } else { linkdata = "<script type=\"text/javascript\">\r\n" + "$(document).ready(function(){ \r\n" + linkdata + "});</script>"; } } else { } }
protected void Page_Load(object sender, EventArgs e) { string field = (string)Request["searchField"]; string value = (string)Request["searchFor"]; string lookupValue = (string)Request["lookupValue"]; Builder builder = Factory.CreateBuilder(); Smarty.Table tableInfo = builder.Tables[strTableName]; Smarty.Field fieldInfo = tableInfo.Fields[field] as Field; CheckSecurity(); if (fieldInfo.LookupFields.Count == 0) { func.PopulateLookupFields(fieldInfo); } for (int i = 0; i < fieldInfo.LookupFields.Count && i < 40; ++i) { if (fieldInfo.LookupFields[i].Display.StartsWith(value, StringComparison.CurrentCultureIgnoreCase)) { output.Append(fieldInfo.LookupFields[i].Link + "\n" + fieldInfo.LookupFields[i].Display + "\n"); } } this.Response.Write(output.ToString()); this.Response.End(); }
protected void BuildBody() { string linkdata = ""; linkdata += "<script type=\"text/javascript\">\r\n"; object value = null; if (Asearchfor.ContainsKey("")) { value = Asearchfor[""]; } object fvalue = null; if (Asearchfor.ContainsKey("NIP")) { fvalue = Asearchfor["NIP"]; } if (useAJAX) { Smarty.Table tableInfo = null; Smarty.Field fieldInfo = null; List <Smarty.LookupField> lookups = null; string txt = ""; } else { } linkdata += "</script>\r\n"; IDictionary <string, object> body = new Dictionary <string, object>(); body["begin"] = GetIncludes(); body["end"] = linkdata + "<script>ShowHideControls()</script>"; smarty.Add("body", body); IDictionary <string, object> contents_block = new Dictionary <string, object>(); contents_block["begin"] = "<form method=\"POST\""; contents_block["begin"] += "action=\"JENISKEGIATAN_list.aspx\""; contents_block["begin"] += "name=\"editform\"><input type=\"hidden\" id=\"a\" name=\"a\" value=\"advsearch\">"; contents_block["end"] = "</form>"; smarty.Add("contents_block", contents_block); smarty.Add("searchbutton_attrs", "name=\"SearchButton\" onclick=\"javascript:document.forms.editform.submit();\""); smarty.Add("resetbutton_attrs", "onclick=\"return ResetControls();\""); smarty.Add("backbutton_attrs", "onclick=\"javascript: document.forms.editform.a.value='return'; document.forms.editform.submit();\""); smarty.Add("conditions_block", true); smarty.Add("search_button", true); smarty.Add("reset_button", true); smarty.Add("back_button", true); }
protected void Page_Load(object sender, EventArgs e) { string field = (string)Request["field"]; string value = (string)Request["value"]; Builder builder = Factory.CreateBuilder(); Smarty.Table tableInfo = builder.Tables[strTableName]; Smarty.Field fieldInfo = tableInfo.Fields[field] as Field; List <LookupField> dependentFields = func.LoadSelectContent(fieldInfo, value, ""); for (int i = 0; i < dependentFields.Count && i < 40; ++i) { output.Append(dependentFields[i].Link + "\n" + dependentFields[i].Display + "\n"); } this.Response.Write(output.ToString()); this.Response.End(); }
private void Wizards() { record_id = Request["recordID"]; object value = null; if (defvalues.ContainsKey("")) { value = defvalues[""]; } object fvalue = null; if (defvalues.ContainsKey("NIP")) { fvalue = defvalues["NIP"]; } if (useAJAX) { if (inlineedit == ADD_MODE.ADD_ONTHEFLY) { record_id = Request["id"]; } Smarty.Table tableInfo = null; Smarty.Field fieldInfo = null; string txt = ""; List <Smarty.LookupField> lookups = null; if (inlineedit == ADD_MODE.ADD_INLINE) { linkdata = linkdata.Replace("&", "&").Replace("<", "<").Replace(">", ">"); } else { linkdata += "SetToFirstControl('" + formname + "');"; if (inlineedit == ADD_MODE.ADD_SIMPLE) { linkdata = "<script type=\"text/javascript\">\r\n" + "$(document).ready(function(){ \r\n" + linkdata + "});</script>"; } else { linkdata = GetIncludes() + "\r\n" + linkdata; string includes = "var s;"; foreach (string file in arr_includes) { includes += "s = document.createElement('script');s.src = '" + file + @"';\r\n" + "document.getElementsByTagName('HEAD')[0].appendChild(s);\r\n"; } linkdata = includes + "\r\n" + linkdata; if (RequestAction != "added") { linkdata = linkdata.Replace("\\", "\\\\").Replace("\r", "\\r").Replace("\n", "\\n"); Response.Write(linkdata); Response.Write("\n"); } else if (RequestAction == "added" && (error_happened || status == "DECLINED")) { Response.Write("<textarea id=\"data\">decli"); Response.Write(Control.HTMLEncodeSpecialChars(linkdata)); Response.Write("</textarea>"); } } } } else { } }
protected void Page_Load(object sender, EventArgs e) { field = (string)Request["field"]; id = (string)Request["id"]; if (!CheckSecurity()) { return; } if (!string.IsNullOrEmpty(categoryField)) { categoryvalue = (string)Request["category"]; } Builder builder = Factory.CreateBuilder(); Smarty.Table tableInfo = builder.Tables[strTableName]; Smarty.Field fieldInfo = tableInfo.Fields[field] as Field; smarty.Add("add_new_item", true); fastType = fieldInfo.FastType; useAjax = true; if (!CheckAddNewItemAllowed(field)) { return; } if (Request["newitem"] != null) { obj = Control.GoodFieldName(field); } mode = Control.FromString((string)Request["mode"]); if (fastType && useAjax) { smarty.Add("fastTypeNAjax", true); if (mode == MODE.MODE_INLINE_EDIT || mode == MODE.MODE_INLINE_ADD) { element = "window.opener.document.getElementById('" + id + "')"; dispelement = "window.opener.document.getElementById('display_" + id + "')"; } else { element = "window.opener.document.forms.editform.value_" + obj; dispelement = "window.opener.document.forms.editform.display_value_" + obj; } smarty.Add("dispelement", dispelement); smarty.Add("element", element); smarty.Add("data1", data1); smarty.Add("data2", data2); } else { smarty.Add("notfastTypeNAjax", true); if (mode == MODE.MODE_INLINE_EDIT || mode == MODE.MODE_INLINE_ADD) { element = "window.opener.document.getElementById('" + id + "')"; } else { element = "window.opener.document.forms.editform.value_" + obj; } if (!string.IsNullOrEmpty(categoryField) && !useAjax) { smarty.Add("notAjaxcategoryField", true); } smarty.Add("dispelement", dispelement); smarty.Add("element", element); smarty.Add("data1", data1); smarty.Add("data2", data2); smarty.Add("data0", data0); smarty.Add("obj", obj); smarty.Add("category", category); } smarty.Add("save_msg", saveMsg); smarty.Add("close_window_msg", closeWindowMsg); this.Response.Write(func.BuildOutput(this, @"~\KELENGKAPAN_addnewitem.aspx", smarty)); this.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { bool suggestAllContent = true; bool searchAll = false; if (Request["start"] == null || (string)Request["start"] == "0") { suggestAllContent = false; } string field = (string)Request["searchField"]; string value = (string)Request["searchFor"]; if (!string.IsNullOrEmpty(value)) { Builder bldr = Factory.CreateBuilder(); Smarty.Table tableInfo = bldr.Tables[strTableName]; if (string.IsNullOrEmpty(field)) { searchAll = true; } List <string> fields = new List <string>(); List <string> items = null; try { Data.POKJAController controller = new Data.POKJAController(); items = searchAll ? controller.FetchForSearchSuggestAll(fields, value, suggestAllContent, OwnerColumn, OwnerID) : controller.FetchForSearchSuggest(field, value, suggestAllContent, OwnerColumn, OwnerID); } catch { items = new List <string>(); items.Add(string.Empty); } foreach (string item in items) { //if (suggestAllContent) //{ string str = item.Substring(0, item.Length > 50 ? 50 : item.Length); int pos = my_stripos(str, value, 0); if (pos < 0) { output.Append(str); } else { output.Append(str.Substring(0, pos) + "<b>" + str.Substring(pos, value.Length) + "</b>" + str.Substring(pos + value.Length)); } output.Append("\n"); //} //else //{ // output.Append("<b>" + item.Substring(0,value.Length) + "</b>" + value.Substring(value.Length, (item.Length > 50 ? 50 : item.Length) - value.Length) + "\n"); //} } } this.Response.Write(output.ToString()); this.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { CheckSecurity(); bool suggestAllContent = true; bool searchAll = false; if (Request["start"] == null || (string)Request["start"] == "0") { suggestAllContent = false; } string field = (string)Request["searchField"]; string value = (string)Request["searchFor"]; if (!string.IsNullOrEmpty(value)) { Builder bldr = Factory.CreateBuilder(); Smarty.Table tableInfo = bldr.Tables[strTableName]; if (string.IsNullOrEmpty(field)) { searchAll = true; } List <string> fields = new List <string>(); List <string> items = null; try { if (string.IsNullOrEmpty(field)) { Field fieldInfo = tableInfo.Fields["KD_VENDOR"] as Field; if (fieldInfo.FieldPermissions) { fields.Add("KD_VENDOR"); } } if (field == "KD_VENDOR") { field = "KD_VENDOR"; if (!bldr.Tables[strTableName].Fields[field].FieldPermissions) { throw new ArgumentException("Access denied"); } } if (string.IsNullOrEmpty(field)) { Field fieldInfo = tableInfo.Fields["STATUS"] as Field; if (fieldInfo.FieldPermissions) { fields.Add("STATUS"); } } if (field == "STATUS") { field = "STATUS"; if (!bldr.Tables[strTableName].Fields[field].FieldPermissions) { throw new ArgumentException("Access denied"); } } Data.Tb_VendorController controller = new Data.Tb_VendorController(); items = searchAll ? controller.FetchForSearchSuggestAll(fields, value, suggestAllContent, OwnerColumn, OwnerID) : controller.FetchForSearchSuggest(field, value, suggestAllContent, OwnerColumn, OwnerID); } catch { items = new List <string>(); items.Add(string.Empty); } foreach (string item in items) { //if (suggestAllContent) //{ string str = item.Substring(0, item.Length > 50 ? 50 : item.Length); int pos = my_stripos(str, value, 0); if (pos < 0) { output.Append(str); } else { output.Append(str.Substring(0, pos) + "<b>" + str.Substring(pos, value.Length) + "</b>" + str.Substring(pos + value.Length)); } output.Append("\n"); //} //else //{ // output.Append("<b>" + item.Substring(0,value.Length) + "</b>" + value.Substring(value.Length, (item.Length > 50 ? 50 : item.Length) - value.Length) + "\n"); //} } } this.Response.Write(output.ToString()); this.Response.End(); }