using System; using System.Collections.Generic; using System.Linq; using System.Web; using EMIS.ViewModel; using Bowin.Common.JSON; using EMIS.Entities; namespace EMIS.Web.Controls { public static class ConfiguretExtensions { public static ConfiguretView GetConfiguretermsView(QueryParamsModel pararms) { ConfiguretView configuretView = new ConfiguretView(); //获取控件 string QueryAttribute = pararms == null ? HttpContext.Current.Request.Form["Attribute"] : pararms.getExtraString("Attribute"); Sys_ConfiguretermsInfo configureterms = QueryAttribute == "-1" || QueryAttribute == null ? null : QueryAttribute.JsonToObject(); if (configureterms != null) { string ControlName = configureterms.Value;//.Replace(".", ""); if (configureterms.ControlType == "TextBox") ControlName += "_QueryTextBox"; else if (configureterms.ControlType == "DropdownList") ControlName += "_QueryDropdownList"; else if (configureterms.ControlType == "DictionaryDropDownList") ControlName += "_QueryDictionaryDropDownList"; else if (configureterms.ControlType == "CheckBox") ControlName += "_QueryCheckBox"; else if (configureterms.ControlType == "ComboGrid") ControlName += "_QueryComboGrid"; else if (configureterms.ControlType == "TextBoxDate") ControlName += "_QueryTextBoxDate"; configuretView.Attribute = configureterms.Value; configuretView.Condition = pararms == null ? HttpContext.Current.Request.Form["Condition"] : pararms.getExtraString("Condition"); configuretView.ConditionValue = pararms == null ? (HttpContext.Current.Request.Form[ControlName] == "-1" ? "" : HttpContext.Current.Request.Form[ControlName]).Trim() : (pararms.getExtraString(ControlName) == "-1" ? "" : pararms.getExtraString(ControlName)).Trim(); } return configuretView; } } }