예제 #1
0
        /// <summary>
        ///     删除按钮响应
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsBtnDel_Click(object sender, EventArgs e)
        {
            if (Alert.confirm(Const.DEL_CONFIRM_MSG))
            {
                var searchCount = _rowsCount;
                var bResult     = false;
                for (var i = 0; i < _rowsCount; i++)
                {
                    _tmpRowIndex = fpDayReportHChuan.Sheets[0].ActiveRowIndex;
                    //遍历“选择”是否选中
                    if (fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, 0].Value != null &&
                        (bool)fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, 0].Value)
                    {
                        //主键
                        tunnelHChuanEntity.Id = Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.ID]);
                        var tmp = 0;
                        //主运顺槽
                        if (int.TryParse(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID1].ToString(), out tmp))
                        {
                            tunnelHChuanEntity.TunnelId1 = tmp;
                            tmp = 0;
                        }
                        //辅运顺槽
                        if (int.TryParse(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID2].ToString(), out tmp))
                        {
                            tunnelHChuanEntity.TunnelId2 = tmp;
                            tmp = 0;
                        }

                        //重设巷道类型
                        var tunnel1 = Tunnel.Find(tunnelHChuanEntity.TunnelId1);
                        tunnel1.TunnelType = TunnelTypeEnum.OTHER;
                        tunnel1.Save();
                        var tunnel2 = Tunnel.Find(tunnelHChuanEntity.TunnelId2);
                        tunnel2.TunnelType = TunnelTypeEnum.OTHER;
                        tunnel2.Save();

                        //删除回采巷道信息
                        bResult = TunnelHChuanBLL.deleteTunnelHChuan(tunnelHChuanEntity);
                    }
                }
                if (bResult)
                {
                    //TODO:删除后事件
                    //将图层中对应的信息删除
                    DelHChuanjc(tunnelHChuanEntity.TunnelId1, tunnelHChuanEntity.TunnelId2);
                    //删除工作面中对应的回采信息
                    /////Mark
                }
                bindFpTunnelHChuanInfo();
                FarPointOperate.farPointFocusSetDel(fpDayReportHChuan, _tmpRowIndex);
            }
        }
예제 #2
0
 public void refreshUpdate()
 {
     bindFpTunnelHChuanInfo();
     FarPointOperate.farPointFocusSetChange(fpDayReportHChuan, _tmpRowIndex);
 }
예제 #3
0
        /// <summary>
        ///     farpoint数据绑定
        /// </summary>
        private void bindFpTunnelHChuanInfo()
        {
            // 清空HashTabl(必须实装)
            _htSelIdxs.Clear();

            //清空Farpoint
            FarPointOperate.farPointClear(fpDayReportHChuan, _rowDetailStartIndex, _rowsCount);

            _checkCount = 0;

            chkSelAll.Checked = false;
            // ※分页必须
            _iRecordCount = TunnelHChuanBLL.selectTunnelHChuan().Tables[0].Rows.Count;

            // ※分页必须
            dataPager1.PageControlInit(_iRecordCount);

            var iStartIndex = dataPager1.getStartIndex();
            var iEndIndex   = dataPager1.getEndIndex();

            _ds = TunnelHChuanBLL.selectTunnelHChuan(iStartIndex, iEndIndex);

            _rowsCount = _ds.Tables[0].Rows.Count;

            //重绘Farpoint
            FarPointOperate.farPointReAdd(fpDayReportHChuan, _rowDetailStartIndex, _rowsCount);

            if (_rowsCount > 0)
            {
                var ckbxcell = new CheckBoxCellType();
                //取消三选
                ckbxcell.ThreeState = false;

                for (var i = 0; i < _ds.Tables[0].Rows.Count; i++)
                {
                    var index = 0;
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, index].CellType = ckbxcell;
                    //主运顺槽
                    var tunnelID1 = Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID1]);
                    //辅运顺槽
                    var tunnelID2 = Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID2]);

                    var tmpTunnelID = (tunnelID1 == 0 ? (tunnelID2 == 0 ? 0 : tunnelID2) : tunnelID1);

                    //矿井名称
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.NAME_HCHUAN].ToString();
                    ;
                    //关联巷道1
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID1].ToString();
                    ;
                    //关联巷道2
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID2].ToString();
                    ;

                    //x1
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_X1].ToString();
                    //y1
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_Y1].ToString();
                    //z1
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_Z1].ToString();
                    //x2
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_X2].ToString();
                    //y2
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_Y2].ToString();
                    //z2
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_Z2].ToString();
                    //azimuth
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_AZIMUTH].ToString();
                    //队别
                    if (int.TryParse(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TEAM_NAME_ID].ToString(), out tmpInt))
                    {
                        fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                            Team.Find(tmpInt).TeamName;
                        tmpInt = 0;
                    }
                    //开工日期
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.START_DATE].ToString()
                        .Substring(0,
                                   _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.START_DATE].ToString().IndexOf(' '));
                    //是否回采完毕
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.IS_FINISH].ToString()) == 1
                            ? Const.MSG_YES
                            : Const.MSG_NO;
                    //停工日期
                    if (Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.IS_FINISH].ToString()) == 1)
                    {
                        fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                            _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.STOP_DATE].ToString()
                            .Substring(0,
                                       _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.STOP_DATE].ToString().IndexOf(' '));
                    }
                    else
                    {
                        ++index;
                    }

                    //工作制式
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.WORK_STYLE].ToString();
                    //班次
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.WORK_TIME].ToString();
                    //状态
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_STATE].ToString();
                    //bid
                    fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, ++index].Text =
                        _ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.ID].ToString();
                    fpDayReportHChuan.Sheets[0].Columns[_BIDIndex].Visible = false;
                }
            }
            //设置按钮可操作性
            setButtenEnable();
        }
예제 #4
0
 public void refreshAdd()
 {
     bindFpTunnelHChuanInfo();
     dataPager1.btnLastPage_Click(null, null);
     FarPointOperate.farPointFocusSetAdd(fpDayReportHChuan, _rowDetailStartIndex, _rowsCount);
 }