Exemplo n.º 1
0
        private static void clearTunnelTypeOfHChuan(int tunnelHChuanID)
        {
            TunnelHChuanEntity tunnelHChuanEntity = selectTunnelHChuan(tunnelHChuanID);

            if (tunnelHChuanEntity != null)
            {
                TunnelInfoBLL.clearTunnelType(tunnelHChuanEntity.TunnelID1);
                TunnelInfoBLL.clearTunnelType(tunnelHChuanEntity.TunnelID2);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定修改信息
        /// </summary>
        private void bindInfo()
        {
            //主运顺槽
            btnTunnelChoose1.Text = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelHCEntity.TunnelID_ZY).TunnelName;
            //辅运顺槽
            btnTunnelChoose2.Text = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelHCEntity.TunnelID_FY).TunnelName;
            //开切眼
            btnTunnelChoose3.Text = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelHCEntity.TunnelID_KQY).TunnelName;
            //其它巷道
            string[] sArray = new string[10];
            if (tunnelHCEntity.TunnelID != null)
            {
                sArray = tunnelHCEntity.TunnelID.Split(',');
            }
            foreach (string i in sArray)
            {
                if (i != "")
                {
                    int iTunnelID = Convert.ToInt16(i);
                    listBox_Browse.Items.Add(TunnelInfoBLL.selectTunnelInfoByTunnelID(iTunnelID).TunnelName);
                }
            }

            tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_ZY;
            //队别名称
            cboTeamName.Text = TeamBLL.selectTeamInfoByID(tunnelHCEntity.TeamNameID).TeamName;

            //开始日期
            dtpStartDate.Value = tunnelHCEntity.StartDate;
            //是否回采完毕
            if (tunnelHCEntity.IsFinish == 1)
            {
                rbtnHCY.Checked = true;
            }
            else
            {
                rbtnHCN.Checked = true;
            }
            //停工日期
            if (tunnelHCEntity.IsFinish == 1)
            {
                dtpStopDate.Value = tunnelHCEntity.StopDate;
            }
            //工作制式
            if (tunnelHCEntity.WorkStyle == rbtn38.Text)
            {
                rbtn38.Checked = true;
            }
            else
            {
                rbtn46.Checked = true;
            }
            //班次
            cboWorkTime.Text = tunnelHCEntity.WorkTime;
        }
Exemplo n.º 3
0
        public static void clearTunnelTypeOfHC(int tunnelHCID)
        {
            TunnelHCEntity tunnelHCEntity = selectTunnelHC(tunnelHCID);

            if (tunnelHCEntity != null)
            {
                TunnelInfoBLL.clearTunnelType(tunnelHCEntity.TunnelID_ZY);
                TunnelInfoBLL.clearTunnelType(tunnelHCEntity.TunnelID_FY);
                TunnelInfoBLL.clearTunnelType(tunnelHCEntity.TunnelID_KQY);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!check())
            {
                DialogResult = DialogResult.None;
                return;
            }
            else
            {
                DialogResult = DialogResult.OK;
            }
            bindTunnelHCEntity();

            bool bResult = false;

            //添加
            if (this.Text == Const_GM.TUNNEL_HC_ADD)
            {
                bResult = TunnelHCBLL.insertTunnelHC(tunnelHCEntity);
            }
            //修改
            if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
            {
                if (tmpTunnelHCEntity.TunnelID_ZY != 0)
                {
                    tunnelHCEntity.TunnelID_ZY = tmpTunnelHCEntity.TunnelID_ZY;
                }
                if (tmpTunnelHCEntity.TunnelID_FY != 0)
                {
                    tunnelHCEntity.TunnelID_FY = tmpTunnelHCEntity.TunnelID_FY;
                }
                if (tmpTunnelHCEntity.TunnelID_KQY != 0)
                {
                    tunnelHCEntity.TunnelID_KQY = tmpTunnelHCEntity.TunnelID_KQY;
                }
                if (tmpTunnelHCEntity.TunnelID != null)
                {
                    tunnelHCEntity.TunnelID = tmpTunnelHCEntity.TunnelID;
                }

                bResult = TunnelHCBLL.updateTunnelHC(tunnelHCEntity);
            }
            if (bResult)
            {
                //TODO:成功后事件
            }
            TunnelInfoBLL.setTunnelAsHC(tunnelHCEntity);
            return;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 添加其他巷道按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_ChooseAdd_Click(object sender, EventArgs e)
        {
            //巷道选择窗体
            TunnelChoose tunnelChoose;

            //第一次选择巷道时给巷道实体赋值,用于下条巷道选择时的控件选择定位
            if (tunnelHCEntity.TunnelID_ZY != 0)
            {
                tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_ZY;
                tunnelEntity          = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelEntity.TunnelID);
            }
            //第一次选择巷道
            if (tunnelEntity.TunnelID == 0)
            {
                tunnelChoose = new TunnelChoose();
            }
            //非第一次选择巷道
            else
            {
                tunnelChoose = new TunnelChoose(tunnelEntity);
            }
            //巷道选择完毕
            if (DialogResult.OK == tunnelChoose.ShowDialog())
            {
                //添加信息到listBox
                listBox_Browse.Items.Add(tunnelChoose.returnTunnelInfo().TunnelName);

                //实体赋值
                if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
                {
                    if ((tmpTunnelHCEntity.TunnelID != "") && (tmpTunnelHCEntity.TunnelID != null))
                    {
                        tmpTunnelHCEntity.TunnelID += ",";
                    }
                    tmpTunnelHCEntity.TunnelID += Convert.ToString(tunnelChoose.returnTunnelInfo().TunnelID);
                }
                if (this.Text == Const_GM.TUNNEL_HC_ADD)
                {
                    if ((tunnelHCEntity.TunnelID != "") && (tunnelHCEntity.TunnelID != null))
                    {
                        tunnelHCEntity.TunnelID += ",";
                    }
                    tunnelHCEntity.TunnelID += Convert.ToString(tunnelChoose.returnTunnelInfo().TunnelID);
                }
                //巷道实体赋值,用于下次巷道选择
                tunnelEntity = tunnelChoose.returnTunnelInfo();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 开切眼
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTunnelChoose3_Click(object sender, EventArgs e)
        {
            //巷道选择窗体
            TunnelChoose tunnelChoose;

            //第一次选择巷道时给巷道实体赋值,用于下条巷道选择时的控件选择定位
            if (tunnelHCEntity.TunnelID_KQY != 0)
            {
                tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_KQY;
                tunnelEntity          = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelEntity.TunnelID);
            }
            //第一次选择巷道
            if (tunnelEntity.TunnelID == 0)
            {
                tunnelChoose = new TunnelChoose();
            }
            //非第一次选择巷道
            else
            {
                tunnelChoose = new TunnelChoose(tunnelEntity);
            }
            //巷道选择完毕
            if (DialogResult.OK == tunnelChoose.ShowDialog())
            {
                //巷道选择按钮Text改变
                btnTunnelChoose3.Text = tunnelChoose.returnTunnelInfo().TunnelName;
                //实体赋值
                if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
                {
                    tmpTunnelHCEntity.TunnelID_KQY = tunnelChoose.returnTunnelInfo().TunnelID;
                }
                if (this.Text == Const_GM.TUNNEL_HC_ADD)
                {
                    tunnelHCEntity.TunnelID_KQY = tunnelChoose.returnTunnelInfo().TunnelID;
                }
                //巷道实体赋值,用于下次巷道选择
                tunnelEntity = tunnelChoose.returnTunnelInfo();
            }
        }
Exemplo n.º 7
0
        private void listBox_Browse_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                int index = listBox_Browse.IndexFromPoint(e.Location);
                if (index >= 0)
                {
                    listBox_Browse.SelectedIndex = index;
                    listBox_Browse.Items.RemoveAt(index);

                    //实体赋值
                    if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
                    {
                        string[] sArray      = new string[10];
                        string   strTunnelID = "";
                        if ((tmpTunnelHCEntity.TunnelID != "") && (tmpTunnelHCEntity.TunnelID != null))
                        {
                            sArray = tmpTunnelHCEntity.TunnelID.Split(',');
                        }
                        int iIndex = 0;
                        foreach (string i in sArray)
                        {
                            if (index != iIndex)
                            {
                                if ((strTunnelID != "") && (strTunnelID != null))
                                {
                                    strTunnelID += ",";
                                }
                                strTunnelID += i;

                                //巷道实体赋值,用于下次巷道选择
                                tunnelEntity.TunnelID = Convert.ToInt16(i);
                                tunnelEntity          = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelEntity.TunnelID);
                            }
                            else
                            {
                                int iTunnelID = Convert.ToInt16(i);
                                TunnelInfoBLL.clearTunnelType(iTunnelID);
                            }
                            iIndex += 1;
                        }

                        tmpTunnelHCEntity.TunnelID = strTunnelID;
                    }
                    if (this.Text == Const_GM.TUNNEL_HC_ADD)
                    {
                        string[] sArray      = new string[10];
                        string   strTunnelID = "";
                        if ((tunnelHCEntity.TunnelID != "") && (tunnelHCEntity.TunnelID != null))
                        {
                            sArray = tunnelHCEntity.TunnelID.Split(',');
                        }
                        int iIndex = 0;
                        foreach (string i in sArray)
                        {
                            if (index != iIndex)
                            {
                                if ((strTunnelID != "") && (strTunnelID != null))
                                {
                                    strTunnelID += ",";
                                }
                                strTunnelID += i;

                                //巷道实体赋值,用于下次巷道选择
                                tunnelEntity.TunnelID = Convert.ToInt16(i);
                                tunnelEntity          = TunnelInfoBLL.selectTunnelInfoByTunnelID(tunnelEntity.TunnelID);
                            }

                            iIndex += 1;
                        }

                        tunnelHCEntity.TunnelID = strTunnelID;
                    }
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 验证
        /// </summary>
        /// <returns>是否验证通过</returns>
        private bool check()
        {
            //巷道选择
            if (tunnelHCEntity.TunnelID_ZY == 0 && tunnelHCEntity.TunnelID_FY == 0 && tunnelHCEntity.TunnelID_KQY == 0)
            {
                Alert.alert(Const.MSG_PLEASE_CHOOSE + Const_GM.TUNNEL + Const.SIGN_EXCLAMATION_MARK);
                return(false);
            }
            //主运顺槽选择
            if (tunnelHCEntity.TunnelID_ZY == 0)
            {
                Alert.alert(Const.MSG_PLEASE_CHOOSE + Const_GM.MAIN_TUNNEL + Const.SIGN_EXCLAMATION_MARK);
                return(false);
            }
            //辅运顺槽选择
            if (tunnelHCEntity.TunnelID_FY == 0)
            {
                Alert.alert(Const.MSG_PLEASE_CHOOSE + Const_GM.SECOND_TUNNEL + Const.SIGN_EXCLAMATION_MARK);
                return(false);
            }
            //开切眼选择
            if (tunnelHCEntity.TunnelID_KQY == 0)
            {
                Alert.alert(Const.MSG_PLEASE_CHOOSE + Const_GM.OOC_TUNNEL + Const.SIGN_EXCLAMATION_MARK);
                return(false);
            }
            //巷道重复选择验证
            if (tunnelHCEntity.TunnelID_ZY == tunnelHCEntity.TunnelID_FY || tunnelHCEntity.TunnelID_FY == tunnelHCEntity.TunnelID_KQY || tunnelHCEntity.TunnelID_KQY == tunnelHCEntity.TunnelID_ZY)
            {
                Alert.alert(Const_GM.TUNNEL_HC_MSG_TUNNEL_DOUBLE_CHOOSE);
                return(false);
            }
            //是否为掘进巷道验证
            //主运顺槽
            if (this.Text == Const_GM.TUNNEL_HC_ADD)
            {
                tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_ZY;
            }
            if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
            {
                tunnelEntity.TunnelID = tmpTunnelHCEntity.TunnelID_ZY;
            }
            if (tmpTunnelHCEntity.TunnelID_ZY != tunnelHCEntity.TunnelID_ZY)
            {
                //检查巷道是否为掘进巷道
                if (TunnelInfoBLL.isTunnelJJ(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose1.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_JJ);
                    return(false);
                }
                //检查巷道是否为回采巷道
                if (TunnelInfoBLL.isTunnelHC(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose1.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_HC);
                    return(false);
                }
            }
            //辅运顺槽
            if (this.Text == Const_GM.TUNNEL_HC_ADD)
            {
                tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_FY;
            }
            if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
            {
                tunnelEntity.TunnelID = tmpTunnelHCEntity.TunnelID_FY;
            }
            if (tmpTunnelHCEntity.TunnelID_FY != tunnelHCEntity.TunnelID_FY)
            {
                //检查巷道是否为掘进巷道
                if (TunnelInfoBLL.isTunnelJJ(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose2.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_JJ);
                    return(false);
                }
                //检查巷道是否为回采巷道
                if (TunnelInfoBLL.isTunnelHC(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose2.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_HC);
                    return(false);
                }
            }
            //开切眼
            if (this.Text == Const_GM.TUNNEL_HC_ADD)
            {
                tunnelEntity.TunnelID = tunnelHCEntity.TunnelID_KQY;
            }
            if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
            {
                tunnelEntity.TunnelID = tmpTunnelHCEntity.TunnelID_KQY;
            }
            if (tmpTunnelHCEntity.TunnelID_KQY != tunnelHCEntity.TunnelID_KQY)
            {
                //检查巷道是否为掘进巷道
                if (TunnelInfoBLL.isTunnelJJ(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose3.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_JJ);
                    return(false);
                }
                //检查巷道是否为回采巷道
                if (TunnelInfoBLL.isTunnelHC(tunnelEntity))
                {
                    Alert.alert(btnTunnelChoose3.Text + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_HC);
                    return(false);
                }
            }

            //其他关联巷道
            if (this.Text == Const_GM.TUNNEL_HC_ADD)
            {
                string[] sArray = new string[10];
                if (tunnelHCEntity.TunnelID != null)
                {
                    sArray = tunnelHCEntity.TunnelID.Split(',');
                }
                int iIndex = 0;
                foreach (string i in sArray)
                {
                    if (i != "")
                    {
                        int iTunnelID = Convert.ToInt16(i);
                        tunnelEntity.TunnelID = iTunnelID;

                        //检查巷道是否为掘进巷道
                        if (TunnelInfoBLL.isTunnelJJ(tunnelEntity))
                        {
                            string strText = listBox_Browse.Items[iIndex].ToString();
                            Alert.alert(strText + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_JJ);

                            //                           listBox_Browse.Items.RemoveAt(iIndex);
                            return(false);
                        }
                        //检查巷道是否为回采巷道
                        if (TunnelInfoBLL.isTunnelHC(tunnelEntity))
                        {
                            string strText = listBox_Browse.Items[iIndex].ToString();
                            Alert.alert(strText + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_HC);

                            //                          listBox_Browse.Items.RemoveAt(iIndex);
                            return(false);
                        }
                    }
                    iIndex += 1;
                }
            }
            if (this.Text == Const_GM.TUNNEL_HC_CHANGE)
            {
                string[] sArray = new string[10];
                if (tmpTunnelHCEntity.TunnelID != null)
                {
                    sArray = tmpTunnelHCEntity.TunnelID.Split(',');
                }
                int iIndex = 0;
                foreach (string i in sArray)
                {
                    if (i != "")
                    {
                        int iTunnelID = Convert.ToInt16(i);
                        tunnelEntity.TunnelID = iTunnelID;

                        //检查巷道是否为掘进巷道
                        if (TunnelInfoBLL.isTunnelJJ(tunnelEntity))
                        {
                            string strText = listBox_Browse.Items[iIndex].ToString();
                            Alert.alert(strText + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_JJ);

                            //                          listBox_Browse.Items.RemoveAt(iIndex);
                            return(false);
                        }
                        //检查巷道是否为回采巷道
                        if (TunnelInfoBLL.isTunnelHC(tunnelEntity))
                        {
                            string strText = listBox_Browse.Items[iIndex].ToString();
                            Alert.alert(strText + Const_GM.TUNNEL_HC_MSG_TUNNEL_IS_HC);

                            //                          listBox_Browse.Items.RemoveAt(iIndex);
                            return(false);
                        }
                    }

                    iIndex += 1;
                }
            }

            //队别为空
            if (!Check.isEmpty(cboTeamName, Const_MS.TEAM_NAME))
            {
                cboTeamName.BackColor = Const.ERROR_FIELD_COLOR;
                return(false);
            }
            else
            {
                cboTeamName.BackColor = Const.NO_ERROR_FIELD_COLOR;
            }
            //验证成功
            return(true);
        }