Пример #1
0
    /// <summary>
    /// 根据资源ID,获取资源配置信息
    /// </summary>
    /// <param name="ResID"></param>
    /// <returns></returns>
    public static SysSettings GetSysSettingsByResID(string ResID)
    {
        SysSettings Sys = null;

        WebServices.Services Resource = new WebServices.Services();
        // string sql = "select top(1) * from SysSettings where [Value]='" + ResID + "' ";
        // DataSet ds = Resource.SelectData(sql);
        UserInfo user = CommonGetInfo.GetUser();
        DataSet  ds   = Resource.GetDataListByResID("437496952875", "", CommonMethod.FilterSql(" and 值='" + ResID + "'"), user.ID);

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                Sys              = new SysSettings();
                Sys.ShowTitle    = ds.Tables[0].Rows[0]["显示Title"].ToString();
                Sys.ENTableName  = ds.Tables[0].Rows[0]["参数关键字"].ToString();
                Sys.KeyWordValue = ds.Tables[0].Rows[0]["参数关键字"].ToString();
                Sys.ResID        = ds.Tables[0].Rows[0]["值"].ToString();

                Sys.AlignColStr    = ds.Tables[0].Rows[0]["左对齐显示字段"].ToString();
                Sys.AddUrl         = ds.Tables[0].Rows[0]["添加地址"].ToString();
                Sys.EidtUrl        = ds.Tables[0].Rows[0]["编辑地址"].ToString();
                Sys.AccessoryCol   = ds.Tables[0].Rows[0]["附件字段"].ToString();
                Sys.FJGLJD         = ds.Tables[0].Rows[0]["附件主子表关联字段"].ToString();
                Sys.AccessoryResID = ds.Tables[0].Rows[0]["附件ResID"].ToString();
                Sys.SettingsNum    = ds.Tables[0].Rows[0]["列表配置号"].ToString();
                Sys.LBLX           = ds.Tables[0].Rows[0]["列表类型"].ToString();
                Sys.DialogWidth    = ds.Tables[0].Rows[0]["弹出层宽度"].ToString() == "" ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["弹出层宽度"]);
                Sys.DialogHeight   = ds.Tables[0].Rows[0]["弹出层高度"].ToString() == "" ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["弹出层高度"]);

                Sys.DefaultOrder   = ds.Tables[0].Rows[0]["默认排序"].ToString();
                Sys.SortBy         = ds.Tables[0].Rows[0]["排序类型"].ToString();
                Sys.TableName      = ds.Tables[0].Rows[0]["数据表名称"].ToString();
                Sys.FilterCondtion = ds.Tables[0].Rows[0]["数据筛选条件"].ToString();

                DataRow dr = ds.Tables[0].Rows[0];
                Sys.IsCheckBox   = NetReusables.DbField.GetBool(ref dr, "是否显示复选框");
                Sys.IsAdd        = NetReusables.DbField.GetBool(ref dr, "启用添加");
                Sys.IsUpdate     = NetReusables.DbField.GetBool(ref dr, "启用修改");
                Sys.IsDelete     = NetReusables.DbField.GetBool(ref dr, "启用删除");
                Sys.IsExp        = NetReusables.DbField.GetBool(ref dr, "启用导出");
                Sys.IsStartWidth = NetReusables.DbField.GetBool(ref dr, "启用字段宽度设置");
                Sys.IsOrder      = NetReusables.DbField.GetBool(ref dr, "是否支持排序");
                Sys.IsRowRight   = NetReusables.DbField.GetBool(ref dr, "是否启用行过滤");
                Sys.URLTarget    = ds.Tables[0].Rows[0]["页面打开方式"].ToString();
                Sys.FootStr      = ds.Tables[0].Rows[0]["统计字段"].ToString();
                return(Sys);
            }
            else
            {
                return(Sys);
            }
        }
        else
        {
            return(Sys);
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BaseKeyWordValue            = Request["BaseKeyWordValue"] == null ? "" : Request["BaseKeyWordValue"];
        HideQueryBox                = Request["HideQueryBox"] == null ? "" : Request["HideQueryBox"];
        ReportKey                   = Request["argReportKey"] == null ? "" : Request["argReportKey"];
        BaseResid                   = Request["BaseResid"] == null ? "" : Request["BaseResid"];
        SearchTitle                 = Request["SearchTitle"] == null ? "" : Request["SearchTitle"];
        IsDynamicallyCreatTableHead = Request["IsDynamicallyCreatTableHead"] == null ? "" : Request["IsDynamicallyCreatTableHead"];

        string vCommonSearchField = CommonGetInfo.GetALLCommonSearchField(BaseResid, ReportKey, "", IsDynamicallyCreatTableHead, true, false, true).Split(new string[] { "[#]" }, StringSplitOptions.RemoveEmptyEntries)[0];

        if (!string.IsNullOrWhiteSpace(vCommonSearchField))
        {
            CommonSearchField = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ReadDataColumnSet> >(vCommonSearchField);
        }
    }
Пример #3
0
    /// <summary>
    /// 获取资源ID
    /// </summary>
    /// <param name="KeyWord"></param>
    /// <returns></returns>
    public static string GetResIDByENKekWord(string KeyWord)
    {
        WebServices.Services Resource = new WebServices.Services();
        //string sql = "select [Value] from SysSettings where ENKeyWord='" + KeyWord + "'";
        //DataSet ds = Resource.SelectData(sql);
        UserInfo user = CommonGetInfo.GetUser();
        DataSet  ds   = Resource.GetDataListByResID("437496952875", "", CommonMethod.FilterSql(" and 参数关键字='" + KeyWord + "'"), user.ID);

        if (ds.Tables.Count > 0)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                return(ds.Tables[0].Rows[0]["值"].ToString());
            }
            else
            {
                return("");
            }
        }
        else
        {
            return("");
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserID   = this.CurrentUser.ID;
        UserName = this.CurrentUser.Name;
        string Condition = "";
        string json      = "";
        string typeValue = Request["typeValue"];

        int PageSize   = Request["rows"] == null ? 10 : Convert.ToInt32(Request["rows"]);
        int PageNumber = Request["page"] == null ? 1 : Convert.ToInt32(Request["page"]);


        if (typeValue == "GetDataByType")
        {
            string ByType = Request["ByType"] == null ? "" : Request["ByType"].ToString();

            if (ByType == "0")
            {
                typeValue = "CommonGetDataByProc";
            }
            else
            {
                typeValue = "GetDataByUserDefinedSql";
            }
        }

        switch (typeValue)
        {
        case "GetDataByUserDefinedSql":
        {
            string            ResID            = "";
            string            SortField        = "";
            string            SortBy           = "";
            string            QueryKeystr      = "";
            string            ROW_NUMBER_ORDER = "";
            bool              NoPaging         = false;
            List <ReportFoot> vReportFoots     = null;

            if (!string.IsNullOrEmpty(Request["ReportFoot"]))
            {
                string s = Request["ReportFoot"].ToString();
                vReportFoots = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ReportFoot> >(s);
            }

            if (!string.IsNullOrEmpty(Request["Condition"]))
            {
                Condition = Request["Condition"].ToString();
            }

            QueryKeystr = Request["QueryKeystr"] == null ? "" : Request["QueryKeystr"].ToString();

            if (!string.IsNullOrWhiteSpace(QueryKeystr))
            {
                if (QueryKeystr.Substring(0, 4).ToLower().Trim() == "and")
                {
                    Condition = Condition + QueryKeystr;
                }
                else
                {
                    Condition = Condition + " and " + QueryKeystr;
                }
            }

            if (!string.IsNullOrEmpty(Request["page"]))
            {
                PageNumber = Convert.ToInt32(Request["page"]);
            }
            if (Request["sort"] != null)
            {
                SortField = Request["sort"].ToString();
            }
            if (Request["order"] != null)
            {
                SortBy = Request["order"].ToString();
            }
            if (Request["ROW_NUMBER_ORDER"] != null)
            {
                ROW_NUMBER_ORDER = Request["ROW_NUMBER_ORDER"].ToString();
            }
            if (Request["NoPaging"] != null)
            {
                NoPaging = true;
            }
            if (Request["UserDefinedSql"] != null)
            {
                ResID = Request["UserDefinedSql"].ToString().Trim();
            }
            json = CommonGetInfo.GetDataByUserDefinedSql(ResID, PageNumber, PageSize, SortField, SortBy, UserID, Condition, ROW_NUMBER_ORDER, NoPaging, vReportFoots, false);
            break;
        }

        case "GetALLCommonSearchField":
        {
            string argResourcesId = Request["argResourcesId"] == null ? "" : Request["argResourcesId"].ToString();
            string argSearchType  = Request["argSearchType"] == null ? "" : Request["argSearchType"].ToString();
            string argReportKey   = Request["argReportKey"] == null ? "" : Request["argReportKey"].ToString();

            string argIsDynamicallyCreatTableHead = Request["argIsDynamicallyCreatTableHead"] == null ? "" : Request["argIsDynamicallyCreatTableHead"].ToString();
            json = CommonGetInfo.GetALLCommonSearchField(argResourcesId, argReportKey, argSearchType, argIsDynamicallyCreatTableHead);
        }
        break;

        case "GetDictionaryReturnRelatedColumn":
            Services  oServices      = new Services();
            string    ResourceID     = Request["ResourceID"];
            string    ResourceColumn = Request["ResourceColumn"];
            DataTable dt             = oServices.GetDictionaryReturnRelatedColumn(ResourceID, ResourceColumn).Tables[0];
            json = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
            break;

        case "GetDictionaryReturnColumn":
            oServices      = new Services();
            ResourceID     = Request["ResourceID"];
            ResourceColumn = Request["ResourceColumn"];
            bool IsMultiselect = Convert.ToBoolean(Convert.ToInt32(Request["IsMultiselect"]));
            dt = oServices.GetDictionaryReturnColumn(ResourceID, ResourceColumn);
            string gridField   = "";
            string searchField = "";
            // string DicResourceID = "";
            string str = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                if (DbField.GetInt(ref dr, "DataType") == 9)
                {
                    string strEnable = "s='<input type=\"checkbox\" name=\"ch_IsEnable\" value=\"_blank\" id=\"ch_IsEnable\" disabled=\"true\"  '+(row." + DbField.GetStr(ref dr, "CD_DISPNAME") + "==\"1\"?\"Checked\":\"\")+' />';";
                    gridField += ",{field: '" + DbField.GetStr(ref dr, "CD_DISPNAME") + "',title:'" + DbField.GetStr(ref dr, "CD_DISPNAME") + "',width:100, sortable:true ,align:'center',formatter: function (value, row, index) {" + strEnable + " return s;}}";
                }
                else
                {
                    gridField += ",{field: '" + DbField.GetStr(ref dr, "CD_DISPNAME") + "',title:'" + DbField.GetStr(ref dr, "CD_DISPNAME") + "',width:100, sortable:true ,align:'center'}";
                }

                searchField += ",{field:'" + DbField.GetStr(ref dr, "CD_DISPNAME") + "'}";
            }

            dt = oServices.GetDictionaryReturnRelatedColumn(ResourceID, ResourceColumn).Tables[0];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                if (!IsMultiselect)
                {
                    str += "," + DbField.GetStr(ref dr, "ResColCNName") + ":\"'+rowData." + DbField.GetStr(ref dr, "DicColCNName") + "+'\"";
                }
                else
                {
                    str += "," + DbField.GetStr(ref dr, "ResColCNName") + ":" + DbField.GetStr(ref dr, "DicColCNName") + "";
                }
            }
            if (!IsMultiselect)
            {
                gridField = "{title:'选择',field:'选择',width:50,align:'center' ,formatter:function(value,rowData,rowIndex){return '<a href=\"javascript:\" onclick=SelectOneRow({" + str.Substring(1) + "})>选择</a>';}}" + gridField;
            }
            else
            {
                gridField = "{field: 'ID',title:'',checkbox:true,width:30, sortable:false ,align:'center'}" + gridField;
            }
            if (gridField.Trim() != "")
            {
                gridField = "[[" + gridField + "]]";
            }
            if (searchField.Trim() != "")
            {
                searchField = "[#][" + searchField.Substring(1) + "]";
            }
            json = gridField + searchField;
            break;

        case "GetDictionaryList":
            oServices      = new Services();
            ResourceID     = Request["ResourceID"];
            ResourceColumn = Server.UrlDecode(Request["ResourceColumn"]);
            if (Request["Condition"] != null)
            {
                Condition = Server.UrlDecode(Request["Condition"]);
            }


            string        DicResourceID = oServices.GetDictionaryReturnResourceID(ResourceID, ResourceColumn);
            PageParameter p             = new PageParameter();
            p.PageIndex = PageNumber - 1;
            p.PageSize  = PageSize;
            p.SortField = "ID";
            p.SortBy    = "";
            DataSet ds       = oServices.GetPageOfDataList(Convert.ToInt64(DicResourceID), CommonMethod.FilterSql(Condition), p, "test");
            string  RowCount = oServices.GetDataListRecordCount(Convert.ToInt64(DicResourceID), UserID, CommonMethod.FilterSql(Condition)).ToString();
            json = "{\"total\":" + RowCount + ",\"rows\":" + Newtonsoft.Json.JsonConvert.SerializeObject(ds.Tables[0]) + "}";
            break;

        case "GetDataOfReportOfDynamicHeadReportColumnStrBySqlStr":
        {
            string ByType = Request["ByType"] == null ? "" : Request["ByType"].ToString();
            string filterRulesByHeadStr = "";
            string frozenColumnsJson    = "";
            string DynamicHeadReportStr = Request["DynamicHeadReportStr"];

            if (ByType == "0")
            {
                string    ProcName        = Request["ProcName"] == null ? "" : Request["ProcName"].ToString();
                string    ProcOutPutCount = Request["ProcOutPutCount"] == null ? "" : Request["ProcOutPutCount"].ToString();
                string    ProcInPutStr    = Request["ProcInPutStr"] == null ? "" : Request["ProcInPutStr"].ToString();
                DataTable vDT             = new DataTable();
                json = CommonGetDataByProc(CommonGetInfo.GetUser(), ProcOutPutCount, ProcInPutStr, ProcName, "", PageSize.ToString(), PageNumber.ToString(), "", "", "", "", out vDT, false, null, true);
            }
            else
            {
                string UserDefinedSql = Request["UserDefinedSql"] == null ? "" : Request["UserDefinedSql"].ToString();
                string SortField      = Request["sort"] == null ? "" : Request["sort"].ToString();
                string SortBy         = Request["order"] == null ? "" : Request["order"].ToString();
                Condition = Request["Condition"] == null ? "" : Request["Condition"].ToString();
                string            ROW_NUMBER_ORDER = Request["ROW_NUMBER_ORDER"].ToString();
                bool              NoPaging         = Request["NoPaging"] == null ? false : true;
                bool              IsExport         = Request["IsExport"] == null ? false : true;;
                List <ReportFoot> vReportFoots     = null;
                if (!string.IsNullOrEmpty(Request["ReportFoot"]))
                {
                    string s = Request["ReportFoot"].ToString();
                    vReportFoots = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ReportFoot> >(s);
                }
                json = CommonGetInfo.GetDataByUserDefinedSql(UserDefinedSql, PageNumber, PageSize, SortField, SortBy, UserID, "", ROW_NUMBER_ORDER, NoPaging, vReportFoots, IsExport, Condition.Trim());
            }
            json = CommonGetInfo.GetColumnsJson(null, out filterRulesByHeadStr, out frozenColumnsJson, json, DynamicHeadReportStr) + "#" + filterRulesByHeadStr + "#" + frozenColumnsJson;
        }
        break;

        case "CommonGetUserDefinedToolBars":
        {
            string keyWordValue      = Request["keyWordValue"] == null ? "" : Request["keyWordValue"].ToString();
            string argToolBarType    = Request["argToolBarType"] == null ? "" : Request["argToolBarType"].ToString();
            bool   argIsUseNewEasyui = Request["argIsUseNewEasyui"] == null ? true : (Request["argIsUseNewEasyui"].ToString() == "1" ? true : false);
            string DelNameStr        = "";
            json  = "^" + CommonGetInfo.CommonGetUserDefinedToolBars(keyWordValue, out DelNameStr, argToolBarType, argIsUseNewEasyui) + "^";
            json += "***" + DelNameStr;
        }
        break;

        case "CommonGetDataByProc":
        {
            string ProcName        = Request["ProcName"] == null ? "" : Request["ProcName"].ToString();
            string ProcOutPutCount = Request["ProcOutPutCount"] == null ? "" : Request["ProcOutPutCount"].ToString();
            string ProcInPutStr    = Request["ProcInPutStr"] == null ? "" : Request["ProcInPutStr"].ToString();

            string SortField = Request["sort"] == null ? "" : Request["sort"].ToString();
            string SortBy    = Request["order"] == null ? "" : Request["order"].ToString();

            bool IsExport = Request["IsExport"] == null ? false : true;

            DataTable vDT = new DataTable();
            json = CommonGetDataByProc(CommonGetInfo.GetUser(), ProcOutPutCount, ProcInPutStr, ProcName, "", PageSize.ToString(), PageNumber.ToString(), "1", "", SortField, SortBy, out vDT, false, null, IsExport);
            break;
        }

        default:
            break;
        }
        Response.Write(json);
    }