Example #1
0
        /// <summary>
        /// 行标题添加
        /// </summary>
        /// <param name="itemChild">子项</param>
        /// <param name="itemProperty">内部名称</param>
        /// <param name="addXiaoJi">是否开始添加小计</param>
        /// <param name="isRowFinish">是否完成</param>
        void RowTittleInit(TongJiDataGrid.TJGridView datagrrd, TongJiItemChild itemChild, string itemProperty, bool addXiaoJi, bool isRowFinish)
        {
            try
            {
                //若有小计,去除
                if (itemChild.PropertyList.Contains("小计"))
                {
                    itemChild.PropertyList.Remove("小计");
                }

                //子级关系
                if (itemChild.DicPropertyCaml != null && rowItemTagList.Contains(itemChild.ParentPropertyName))
                {
                    itemChild.IntIndenttitys.Clear();

                    List <string> titleSumList = new List <string>();

                    //遍历进行列标题的添加
                    for (int p = 0; p < itemChild.DicPropertyCaml.Count; p++)
                    {
                        if (itemChild.DicPropertyCaml.Values.ElementAt(p).Contains("小计"))
                        {
                            itemChild.DicPropertyCaml.Values.ElementAt(p).Remove("小计");
                        }

                        //加一个映射点
                        itemChild.IntIndenttitys.Add(itemChild.DicPropertyCaml.Values.ElementAt(p).Count);

                        //通过列表名称获取其标题内容(加载最后一行标题标注为完成)
                        if (addXiaoJi && _IsNeedXiaoJi)
                        {
                            itemChild.DicPropertyCaml.Values.ElementAt(p).Add("小计");
                            itemChild.IntIndenttitys[p]++;
                        }
                        titleSumList.AddRange(itemChild.DicPropertyCaml.Values.ElementAt(p));
                    }
                    //通过列表名称获取其标题内容
                    datagrrd._RowHeaderAdd(titleSumList, itemChild.IntIndenttitys, isRowFinish);
                }
                else
                {
                    //最后一列有小计
                    if (addXiaoJi && _IsNeedXiaoJi)
                    {
                        itemChild.PropertyList.Add("小计");
                    }
                    //添加行标题
                    datagrrd._RowHeaderAdd(itemChild.PropertyList, isRowFinish);
                }

                //如SheBeiTypeErJi
                rowItemTagList.Add(itemProperty);
            }
            catch (Exception ex)
            {
                MethodLb.CreateLog(this.GetType().FullName, "RowTittleInit", ex.ToString(), itemChild, itemProperty, addXiaoJi, isRowFinish);
            }
        }
Example #2
0
        /// <summary>
        /// 列标题添加
        /// </summary>
        /// <param name="itemChild">子项</param>
        /// <param name="itemProperty">内部名称</param>
        /// <param name="addXiaoJi">是否开始添加小计</param>
        /// <param name="isRowFinish">是否完成</param>
        void ColumnTittleInit(TJGridView datagrrd, TongJiItemChild itemChild, string itemProperty, bool addXiaoJi, bool isColumnFinish)
        {
            try
            {
                //去除小计
                if (itemChild.PropertyList.Contains("小计"))
                {
                    itemChild.PropertyList.Remove("小计");
                }

                if (itemChild.DicPropertyCaml != null && columnItemTagList.Contains(itemChild.ParentPropertyName))
                {
                    //标题内容
                    List <string> titleSum = new List <string>();

                    //映射数
                    itemChild.IntIndenttitys.Clear();

                    //遍历进行行标题的添加
                    for (int p = 0; p < itemChild.DicPropertyCaml.Count; p++)
                    {
                        if (itemChild.DicPropertyCaml.Values.ElementAt(p).Contains("小计"))
                        {
                            itemChild.DicPropertyCaml.Values.ElementAt(p).Remove("小计");
                        }
                        //加一个映射点
                        itemChild.IntIndenttitys.Add(itemChild.DicPropertyCaml.Values.ElementAt(p).Count);

                        if (addXiaoJi && _IsNeedXiaoJi)
                        {
                            itemChild.DicPropertyCaml.Values.ElementAt(p).Add("小计");
                            itemChild.IntIndenttitys[p]++;
                        }
                        //添加标题
                        titleSum.AddRange(itemChild.DicPropertyCaml.Values.ElementAt(p));
                    }
                    //通过列表名称获取其标题内容
                    datagrrd._ColumnHeaderAdd(titleSum, itemChild.IntIndenttitys, isColumnFinish);
                }
                else
                {
                    if (addXiaoJi && _IsNeedXiaoJi)
                    {
                        itemChild.PropertyList.Add("小计");
                    }
                    datagrrd._ColumnHeaderAdd(itemChild.PropertyList, isColumnFinish);
                }
                columnItemTagList.Add(itemProperty);
            }
            catch (Exception ex)
            {
                MethodLb.CreateLog(this.GetType().FullName, "TongJi", ex.ToString(), itemChild, itemProperty, addXiaoJi, isColumnFinish);
            }
        }
Example #3
0
 public DataGridUserEntityItem(string tittle, string propertt, TongJiItemChild child)
 {
     this.Tittle      = tittle;
     this.StrProperty = propertt;
     this.ItemChild   = child;
 }