コード例 #1
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;
        }
コード例 #2
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();
            }
        }
コード例 #3
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();
            }
        }
コード例 #4
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;
                    }
                }
            }
        }