Пример #1
0
        /// <summary>
        /// 初始化生成
        /// </summary>
        /// <param name="listColumn">集合</param>
        /// <param name="shiGongManagerList">施工集合</param>
        /// <param name="is注册">注册</param>
        public void DataInit(List <string> listColumn, List <IShiGongManager> shiGongManagerList, ref string is注册)
        {
            try
            {
                #region 格式化原有内容

                this.rolist.Clear();
                this.items1.Clear();
                this.dataList.Clear();
                this.sp1.Children.Clear();

                #endregion

                //菜单生成
                MenuInit();
                //使两个Scrovell同事进行
                ScrollBinding(ref is注册);

                // 添加列
                this.RowInitLeft(listColumn);

                //数据添加
                foreach (var item in shiGongManagerList)
                {
                    if (item != null && item is IShiGongManager)
                    {
                        DataControl dataControl = new DataControl(item as IShiGongManager);
                        dataControl.Tag = item;
                        dataList.Add(dataControl);
                    }
                }
                //生成bord
                enitt = new UserControlOperate(SelectBorderBursh);

                //添加使用对象(数据)
                this.UserAdd(dataList);
                //使用者名称集合
                List <string> strList = new List <string>();
                //使用者名称集合添加内容
                foreach (var item in dataList)
                {
                    item.MouseRightButtonDown += (object sender, MouseButtonEventArgs e) =>
                    {
                        menu1.Tag = sender;
                    };
                    strList.Add(item.Text);
                }

                Flush(DateTime.Now.Year.ToString() + "年", DateTime.Now.Month.ToString("00") + "月");
            }
            catch (Exception ex)
            {
                MethodLb.CreateLog(this.GetType().FullName, "DataInit", ex.ToString(), listColumn, shiGongManagerList, is注册);
            }
            finally
            {
            }
        }
Пример #2
0
        /// <summary>
        /// 添加日期和表格
        /// </summary>
        /// <param name="d1">起始时间</param>
        /// <param name="d2">终止时间</param>
        private void DateGridInit(DateTime d1, DateTime d2)
        {
            try
            {
                if (enitt != null)
                {
                    //删除日期
                    this.sp2.Children.Clear();
                    //删除表格日期
                    this.enitt.Clear();
                    //删除表格列
                    this.enitt.grid.ColumnDefinitions.Clear();
                    //删除表格行
                    this.enitt.grid.RowDefinitions.Clear();
                    //删除表格内容
                    this.enitt.grid.Children.Clear();
                }

                this.enitt = new UserControlOperate(d1, d2, rolist.Count, SelectBorderBursh);
                //如果皮肤有修改记录,则进行皮肤设置
                if (DefaultColor != default(Color))
                {
                    SkinChange(DefaultColor);
                }

                //添加日期
                foreach (var item in this.enitt)
                {
                    //添加日期
                    this.sp2.Children.Add(item);
                }

                //添加表格
                grr.Children.Add(this.enitt.grid);
            }
            catch (Exception ex)
            {
                MethodLb.CreateLog(this.GetType().FullName, "DateGridInit", ex.ToString(), d1, d2);
            }
            finally
            {
            }
        }