Ejemplo n.º 1
0
        private void FrmQueryTestAttatch_Load(object sender, EventArgs e)
        {
            lbl_testCode.Text = "任务编号:" + now_taskID;
            lst_attatch.Items.Clear();

            //查询选择任务编号是否存在附件信息
            ProxyBllTEST_PREPARE_ATTATCH blltest_attatch = new ProxyBllTEST_PREPARE_ATTATCH();
            DataSet _dsCommandInfo = new DataSet();

            try
            {
                //绑定数据
                _dsCommandInfo = blltest_attatch.GetList(" F_TEST_TASK_ID='" + now_taskID + "' ");

                if (_dsCommandInfo != null && _dsCommandInfo.Tables.Count > 0)
                {
                    for (int i = 0; i < _dsCommandInfo.Tables[0].Rows.Count; i++)
                    {
                        lst_attatch.Items.Add(_dsCommandInfo.Tables[0].Rows[i]["F_ATTATCHNAME"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error(GetType() + "->" + ApplicationCommon.GetMethodName() + "---FAILED", ex);
                throw ex;
            }
        }
Ejemplo n.º 2
0
        private void gvList_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (gvList.FocusedRowHandle < 0)
            {
                MessageBox.Show("请在试验任务列表中选择试验任务!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                String now_taskid = "";
                //试验任务编号
                now_taskid = gvList.GetFocusedRowCellValue("F_TEST_TASK_ID").ToString();

                //查询选择任务编号是否存在附件信息
                ProxyBllTEST_PREPARE_ATTATCH blltest_attatch = new ProxyBllTEST_PREPARE_ATTATCH();
                DataSet _dsCommandInfo = new DataSet();
                try
                {
                    //绑定数据
                    _dsCommandInfo = blltest_attatch.GetList(" F_TEST_TASK_ID='" + now_taskid + "' ");

                    if (_dsCommandInfo != null && _dsCommandInfo.Tables.Count > 0)
                    {
                        if (_dsCommandInfo.Tables[0].Rows.Count > 0)
                        {
                            btn_Query_attatchment.Enabled = true;
                        }
                        else
                        {
                            btn_Query_attatchment.Enabled = false;
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(GetType() + "->" + ApplicationCommon.GetMethodName() + "---FAILED", ex);
                    throw ex;
                }
            }
        }