Beispiel #1
0
 public List <SYS_DataGridResult> GetAllGridColList(SYS_DataGridParam param)
 {
     #region condtion defined
     Guid?[] arrDGID = new Guid?[] { };
     List <SYS_DataGridResult> ret = new List <SYS_DataGridResult>();
     #endregion
     #region 表格定义配置
     WhereClip whereClip = WhereClip.All;
     ret = this.SelectList <SYS_DataGridResult>(whereClip);
     if (ret.Count > 0)
     {
         arrDGID = ret.Select(a => a.DGGUID).ToArray();
     }
     else
     {
         return(ret);
     }
     #endregion
     #region index defined
     Guid?companyID = this.SessionInfo.CompanyID;
     Guid?userGuid  = this.SessionInfo.UserGuid;
     List <SYS_UserGridColIndex> colIdxList = this.SelectList <SYS_UserGridColIndex>(SYS_UserGridColIndex._.DGGUID.In(arrDGID) &&
                                                                                     SYS_UserGridColIndex._.CompanyID == companyID &&
                                                                                     SYS_UserGridColIndex._.UserGUID == userGuid
                                                                                     , SYS_UserGridColIndex._.DGGUID.Asc && SYS_UserGridColIndex._.DisplayIndex.Asc);
     List <SYS_UserGridColIndex> findIdxList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findIdxList       = colIdxList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColIndexList = findIdxList;
     }
     #endregion
     #region width defined
     List <SYS_UserGridColWidth> colWdthList = this.SelectList <SYS_UserGridColWidth>(SYS_UserGridColWidth._.DGGUID.In(arrDGID) &&
                                                                                      SYS_UserGridColWidth._.CompanyID == companyID &&
                                                                                      SYS_UserGridColWidth._.UserGUID == userGuid
                                                                                      , SYS_UserGridColWidth._.DGGUID.Asc && SYS_UserGridColWidth._.CWID.Asc);
     List <SYS_UserGridColWidth> findWdthList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findWdthList      = colWdthList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColWidthList = findWdthList;
     }
     #endregion
     #region name defined
     List <SYS_UserGridColName> colNameList = this.SelectList <SYS_UserGridColName>(SYS_UserGridColName._.DGGUID.In(arrDGID) &&
                                                                                    SYS_UserGridColName._.CompanyID == companyID
                                                                                    , SYS_UserGridColName._.DGGUID.Asc && SYS_UserGridColName._.CNID.Asc);
     List <SYS_UserGridColName> findNameList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findNameList     = colNameList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColNameList = findNameList;
     }
     #endregion
     return(ret);
 }
Beispiel #2
0
        public void GetGridColListInForm(List <UcDataGridView> lstDgv)
        {
            _isFormPeriod = true;
            #region 获取相关的参数
            List <string> lstGridNames = new List <string>();
            List <string> lstFormName  = new List <string>();
            List <string> lstUConName  = new List <string>();
            string        name         = "";
            foreach (UcDataGridView dgv in lstDgv)
            {
                lstGridNames.Add(dgv.Name);
                name = dgv.FindForm().Name;
                if (!lstFormName.Contains(name))
                {
                    lstFormName.Add(dgv.FindForm().Name);
                }

                Control parentCon = dgv.Parent;
                while (parentCon != null && parentCon.GetType().BaseType != typeof(ucBaseUserControl))
                {
                    parentCon = parentCon.Parent;
                }
                if (parentCon != null)
                {
                    name = (parentCon as ucBaseUserControl).Name;
                    if (!lstUConName.Contains(name))
                    {
                        lstUConName.Add(name);
                    }
                }
            }
            #endregion
            #region 设置相关窗体表格变量
            SYS_DataGridParam param = new SYS_DataGridParam()
            {
                ParentNames = lstUConName.ToArray(),
                GridNames   = lstGridNames.ToArray(),
                FormNames   = lstFormName.ToArray()
            };
            ExeResult rst = WCFBLL.Execute("ZNLCRM.BLL.Sys.SYS_DataGridBLL", "GetGridColList", param);
            if (rst.Complete == ExeComplete.ErrorEx)
            {
                MessageBox.Show(rst.DebugMsg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (rst.Complete == ExeComplete.WarnEx)
            {
                MessageBox.Show(rst.Message, "警告提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (rst.Complete == ExeComplete.Succeed)
            {
                DataGridSettingInForm = rst.Result as List <SYS_DataGridResult>;
            }
            #endregion
        }
Beispiel #3
0
        private void GetGridColSetList(SYS_DataGridParam param)
        {
            List <SYS_DataGridResult> ret = new List <SYS_DataGridResult>();
            ExeResult rst = WCFBLL.Execute("ZNLCRM.BLL.Sys.SYS_DataGridBLL", "GetGridColList", param);

            if (rst.Complete == ExeComplete.ErrorEx)
            {
                MessageBox.Show(rst.DebugMsg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (rst.Complete == ExeComplete.WarnEx)
            {
                MessageBox.Show(rst.Message, "警告提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (rst.Complete == ExeComplete.Succeed)
            {
                ret = rst.Result as List <SYS_DataGridResult>;
                SetDataGridSettingVar(ret);
            }
        }
Beispiel #4
0
 public List <SYS_DataGridResult> GetGridColList(SYS_DataGridParam param)
 {
     #region condtion defined
     Guid?[] arrDGID = new Guid?[] { };
     List <SYS_DataGridResult> ret = new List <SYS_DataGridResult>();
     if (param.GridNames == null || param.FormNames == null || param.ParentNames == null ||
         param.GridNames.Length <= 0 || param.FormNames.Length <= 0 || param.ParentNames.Length <= 0)
     {
         throw new WarnException("请指定表格条件!");
     }
     #endregion
     #region 表格定义配置
     WhereClip whereClip   = WhereClip.All;
     string[]  parentNames = param.ParentNames.Where(a => a != null).ToArray();
     whereClip = whereClip && SYS_DataGrid._.GridName.In(param.GridNames) &&
                 SYS_DataGrid._.FormName.In(param.FormNames);
     if (parentNames.Length > 0)
     {
         whereClip = whereClip && SYS_DataGrid._.ParentName.In(parentNames);
     }
     ret = this.SelectList <SYS_DataGridResult>(whereClip);
     if (ret.Count > 0)
     {
         arrDGID = ret.Select(a => a.DGGUID).ToArray();
     }
     else
     {
         return(ret);
     }
     #endregion
     #region index defined
     Guid?companyID = this.SessionInfo.CompanyID;
     Guid?userGuid  = this.SessionInfo.UserGuid;
     List <SYS_UserGridColIndex> colIdxList = this.SelectList <SYS_UserGridColIndex>(SYS_UserGridColIndex._.DGGUID.In(arrDGID) &&
                                                                                     SYS_UserGridColIndex._.CompanyID == companyID &&
                                                                                     SYS_UserGridColIndex._.UserGUID == userGuid
                                                                                     , SYS_UserGridColIndex._.DisplayIndex.Asc);
     List <SYS_UserGridColIndex> findIdxList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findIdxList       = colIdxList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColIndexList = findIdxList;
     }
     #endregion
     #region width defined
     List <SYS_UserGridColWidth> colWdthList = this.SelectList <SYS_UserGridColWidth>(SYS_UserGridColWidth._.DGGUID.In(arrDGID) &&
                                                                                      SYS_UserGridColWidth._.CompanyID == companyID &&
                                                                                      SYS_UserGridColWidth._.UserGUID == userGuid
                                                                                      , SYS_UserGridColWidth._.CWID.Asc);
     List <SYS_UserGridColWidth> findWdthList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findWdthList      = colWdthList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColWidthList = findWdthList;
     }
     #endregion
     #region name defined
     List <SYS_UserGridColName> colNameList = this.SelectList <SYS_UserGridColName>(SYS_UserGridColName._.DGGUID.In(arrDGID) &&
                                                                                    SYS_UserGridColName._.CompanyID == companyID
                                                                                    , SYS_UserGridColName._.CNID.Asc);
     List <SYS_UserGridColName> findNameList = null;
     foreach (SYS_DataGridResult info in ret)
     {
         findNameList     = colNameList.Where(a => a.DGGUID == info.DGGUID).ToList();
         info.ColNameList = findNameList;
     }
     #endregion
     return(ret);
 }