Exemplo n.º 1
0
        /// <summary>
        ///     窗体登陆时加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PreWarningResultQuery_Load(object sender, EventArgs e)
        {
            #region 设定默认的时间

            _dtpStartTime.ValueChanged -= _dtpStartTime_ValueChanged;
            _dtpEndTime.ValueChanged   -= _dtpStartTime_ValueChanged;
            _dtpEndTime.Value           = DateTime.Now;
            _dtpStartTime.Value         = DateTime.Now.AddDays(-1);
            _dtpStartTime.ValueChanged += _dtpStartTime_ValueChanged;
            _dtpEndTime.ValueChanged   += _dtpStartTime_ValueChanged;

            #endregion

            //加载预警类型
            //AddWarningType();
            var workingFace = WorkingFace.FindAll();
            _cbxSelWorkSurface.Items.Add("全部");
            _cbxSelWorkSurface.SelectedIndex = 0;
            foreach (var t in workingFace)
            {
                _cbxSelWorkSurface.Items.Add(t.WorkingFaceName);
            }

            //设置farpoint显示行列数
            _fpTunelInfo.ActiveSheet.RowCount = 0;
            for (var i = 5; i < COLUMN_COUNT; i++)
            {
                _fpTunelInfo.ActiveSheet.Columns[i].Visible = false;
            }

            //Mark By QinKai,若添加新的预警依据项,需要更改的内容
            //加载预警依据的类别
            var WaringItemTypeNames = Enum.GetNames(typeof(WarningReasonItems));
            cbWarningType.SelectedIndex = 0;

            for (var index = 0; index < WaringItemTypeNames.Length; index++)
            {
                infoCells[_iDetailsRowHeaderCount + index, 0].Text = WaringItemTypeNames[index];
                infoCells[WaringItemTypeNames.Length + _iDetailsRowHeaderCount * 2 + index, 0].Text =
                    WaringItemTypeNames[index];
            }
        }
Exemplo n.º 2
0
        private void beDelete_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (!Alert.confirm("确认删除数据?"))
            {
                return;
            }
            switch (_typeFlag)
            {
            case FlagManangingMineName:
                // 矿井名称管理
                DeleteInfo <Mine>();
                gridControl1.DataSource = CollectionHelper.ConvertTo(Mine.FindAll());
                break;

            case FlagManangingHorizontal:
                // 水平名称管理
                DeleteInfo <Horizontal>();
                gridControl1.DataSource = CollectionHelper.ConvertTo(Horizontal.FindAll());
                break;

            case FlagManangingMiningArea:
                // 采区名称管理
                DeleteInfo <MiningArea>();
                gridControl1.DataSource = CollectionHelper.ConvertTo(MiningArea.FindAll());
                break;

            case FlagManangingWorkingFace:
                // 工作面名称管理
                DeleteInfo <WorkingFace>();
                gridControl1.DataSource = CollectionHelper.ConvertTo(WorkingFace.FindAll());
                break;

            case FlagManangingCoalSeam:
                // 煤层名称管理
                DeleteInfo <CoalSeams>();
                gridControl1.DataSource = CollectionHelper.ConvertTo(CoalSeams.FindAll());
                break;
            }
        }
Exemplo n.º 3
0
        public static List <WorkingFaceHc> FindAll()
        {
            var results = new List <WorkingFaceHc>();

            using (new SessionScope())
            {
                var workingFaces = WorkingFace.FindAll();
                results.AddRange(from workingFace in workingFaces
                                 let tunnelZy = workingFace.Tunnels.FirstOrDefault(u => u.TunnelType == TunnelTypeEnum.STOPING_ZY)
                                                let tunnelFy = workingFace.Tunnels.FirstOrDefault(u => u.TunnelType == TunnelTypeEnum.STOPING_FY)
                                                               let tunnelQy = workingFace.Tunnels.FirstOrDefault(u => u.TunnelType == TunnelTypeEnum.STOPING_QY)
                                                                              let tunnelOther = workingFace.Tunnels.Where(u => u.TunnelType == TunnelTypeEnum.OTHER).ToList()
                                                                                                where tunnelZy != null && tunnelFy != null && tunnelQy != null
                                                                                                select new WorkingFaceHc
                {
                    WorkingFace = workingFace,
                    TunnelZy    = tunnelZy,
                    TunnelFy    = tunnelFy,
                    TunnelQy    = tunnelQy,
                    TunnelOther = tunnelOther
                });
            }
            return(results);
        }
Exemplo n.º 4
0
        /// <summary>
        ///     带参数的构造方法
        /// </summary>
        /// <param name="typeFlag"></param>
        /// <param name="id"></param>
        public CommonManagement(int typeFlag, int id)
        {
            InitializeComponent();

            Id        = id;
            _typeFlag = typeFlag;

            switch (typeFlag)
            {
            case FlagManangingMineName:
            {
                // 窗口标题
                Text = @"矿井名称管理";
                AddIdColumn("编号", "MineId");

                // 矿井名称
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"矿井名称",
                        FieldName    = "MineName",
                        VisibleIndex = gridView1.Columns.Count
                    });

                AddDeleteButton();

                gridControl1.DataSource = CollectionHelper.ConvertTo(Mine.FindAll());
            }
            break;

            case FlagManangingHorizontal:
            {
                Text = @"水平名称管理";
                AddIdColumn("编号", "HorizontalId");

                // 矿井名称
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"水平名称",
                        FieldName    = "HorizontalName",
                        VisibleIndex = gridView1.Columns.Count
                    });

                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"所在矿区",
                        FieldName    = "Mine",
                        ColumnEdit   = lueMine,
                        VisibleIndex = gridView1.Columns.Count,
                        FilterMode   = ColumnFilterMode.DisplayText
                    });

                AddDeleteButton();
                lueMine.DataSource      = Mine.FindAll();
                gridControl1.DataSource = CollectionHelper.ConvertTo(Horizontal.FindAll());
            }
            break;

            case FlagManangingMiningArea:
            {
                Text = @"采区名称管理";
                AddIdColumn("编号", "MiningAreaId");

                // 矿井名称
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"采区名称",
                        FieldName    = "MiningAreaName",
                        VisibleIndex = gridView1.Columns.Count
                    });


                // 所属水平
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"所在水平",
                        FieldName    = "Horizontal",
                        ColumnEdit   = lueHorizontal,
                        VisibleIndex = gridView1.Columns.Count,
                        FilterMode   = ColumnFilterMode.DisplayText
                    });

                AddDeleteButton();
                lueHorizontal.DataSource = Horizontal.FindAll();
                gridControl1.DataSource  = CollectionHelper.ConvertTo(MiningArea.FindAll());
            }
            break;

            case FlagManangingWorkingFace:
            {
                Text = @"工作面名称管理";
                AddIdColumn("编号", "WorkingFaceId");

                // 矿井名称
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"工作面名称",
                        FieldName    = "WorkingFaceName",
                        VisibleIndex = gridView1.Columns.Count
                    });

                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"所在采区",
                        FieldName    = "MiningArea",
                        ColumnEdit   = lueMiningArea,
                        VisibleIndex = gridView1.Columns.Count,
                        FilterMode   = ColumnFilterMode.DisplayText
                    });

                AddDeleteButton();
                lueMiningArea.DataSource = MiningArea.FindAll();
                gridControl1.DataSource  = CollectionHelper.ConvertTo(WorkingFace.FindAll());
            }
            break;

            case FlagManangingCoalSeam:
            {
                //// 窗口标题
                Text = @"煤层名称管理";
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"编号",
                        FieldName    = "CoalSeamsId",
                        MaxWidth     = 60,
                        VisibleIndex = gridView1.Columns.Count
                    });
                // 矿井名称
                gridView1.Columns.Add(new GridColumn
                    {
                        Caption      = @"煤层名称",
                        FieldName    = "CoalSeamsName",
                        VisibleIndex = gridView1.Columns.Count
                    });
                AddDeleteButton();
                gridControl1.DataSource = CollectionHelper.ConvertTo(CoalSeams.FindAll());
            }
            break;
            }
        }