예제 #1
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void IniData()
        {
            //处理查询方式数据源 BEGIN
            DataTable dtQueryType = new DataTable();

            dtQueryType.Columns.Add(new DataColumn("Name", typeof(string)));
            for (int i = 0; i < saveQueryTypeArray.Length; i++)
            {
                DataRow dr = dtQueryType.NewRow();
                dr["Name"] = saveQueryTypeArray[i];
                dtQueryType.Rows.Add(dr);
            }
            FCommon.LoadDropRepositoryComb(drpQType, dtQueryType, "Name", true);
            //处理查询方式数据源 END


            //绑定查询字段数据源 BEGIN
            drpColFieldName.ShowHeader = false;
            drpColFieldName.ShowFooter = false;
            FCommon.RepositoryLookupEditColAdd(drpColFieldName, new int[] { 0, 100 }, new string[] { "FieldName", "Caption" }, new string[] { "", "" }, new bool[] { false, true });
            DataTable dtParentQueryFiled = GetParentQueryFiled();

            FCommon.LoadDropRepositoryLookUP(drpColFieldName, dtParentQueryFiled, "Caption", "FieldName", false);//查询数据
            //绑定查询字段数据源 END

            BindGrid(GetGridSource());//处理Grid

            if (_HTDataQueryFieldDefault.Count != 0)
            {
                for (int i = 0; i < _HTDataQueryFieldDefault.Count; i++)
                {
                    if (gridView1.RowCount <= i || dtParentQueryFiled.Rows.Count <= i)//溢出,异常退出循环
                    {
                        break;
                    }
                    string[] tempA = (string[])_HTDataQueryFieldDefault[i];//默认数组

                    gridView1.SetRowCellValue(i, "ConType", tempA[0]);
                    gridView1.SetRowCellValue(i, "ColFieldName", tempA[1]);
                    gridView1.SetRowCellValue(i, "QType", tempA[2]);
                }
            }
            else
            {
                //初始化前5行数据
                for (int i = 0; i < 5; i++)                                            //初始化5行
                {
                    if (gridView1.RowCount <= i || dtParentQueryFiled.Rows.Count <= i) //溢出,异常退出循环
                    {
                        break;
                    }
                    gridView1.SetRowCellValue(i, "ColFieldName", dtParentQueryFiled.Rows[i]["FieldName"].ToString());
                    gridView1.SetRowCellValue(i, "QType", "=");
                }
            }
        }
예제 #2
0
 /// <summary>
 /// 绑定CLS
 /// </summary>
 public static void BindCLS(RepositoryItemComboBox p_DrpID, string p_TableName, string p_FieldName, bool p_AllowEdit, bool p_ShowBlank)
 {
     if (p_AllowEdit)
     {
         p_DrpID.TextEditStyle = TextEditStyles.Standard;
     }
     else
     {
         p_DrpID.TextEditStyle = TextEditStyles.DisableTextEditor;
     }
     FCommon.LoadDropRepositoryComb(p_DrpID, BindCLSDataSource(p_TableName, p_FieldName), "CLSNM", p_ShowBlank);
 }