Beispiel #1
0
        private void OnReleaseResultBtnClick(object sender, EventArgs e)
        {
            try
            {
                SortedList condition = new SortedList();
                //condition.Add(1, "12");
                if (mainTab.SelectedIndex == 2)
                {
                    if (dgv_base.SelectedRows != null && dgv_base.SelectedRows.Count > 0)
                    {
                        condition.Add(1, Convert.ToString(dgv_base.SelectedRows[0].Cells["BCU_code"].Value));
                    }
                }
                else if (mainTab.SelectedIndex == 0)
                {
                    if (dgv_temp.SelectedRows != null && dgv_temp.SelectedRows.Count > 0)
                    {
                        condition.Add(1, Convert.ToString(dgv_temp.SelectedRows[0].Cells["tset_code"].Value));
                    }
                }
                CnasRemotCall remoteCall = new CnasRemotCall();
                                #if DEBUG
                string testSql = remoteCall.RemotInterface.CheckSelectData("HCS-release-data-sec001", condition);
                                #endif

                DataTable data = remoteCall.RemotInterface.SelectData("HCS-release-data-sec001", condition);
                if (data != null && data.Rows.Count > 0)
                {
                    SortedList releaseData = new SortedList();
                    releaseData.Add("dev_name", Convert.ToString(data.Rows[0]["dev_name"]));
                    releaseData.Add("batch_num", Convert.ToString(data.Rows[0]["device_runtimes"]));
                    releaseData.Add("object_id", Convert.ToString(data.Rows[0]["dev_id"]));
                    releaseData.Add("bar_code", Convert.ToString(data.Rows[0]["container_code"]));
                    releaseData.Add("release_type", "12");
                    //releaseData.Add("result", (data.Rows[0]["release_result"] is DBNull) ? string.Empty : Convert.ToString(data.Rows[0]["release_result"]));
                    HCSWF_device_result_add dialog = new HCSWF_device_result_add(releaseData, 1);
                    //dialog.IsInsertResult = true;
                    dialog.OperationUser = CnasBaseData.UserBaseInfo;
                    dialog.ShowDialog();
                }
                else
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("NotFountReleaseInfo", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
            }
        }
 public void AddMachineCheck()
 {
     if (!string.IsNullOrEmpty(_machineId))
     {
         this.Invoke(new Action(() => {
             SortedList data = new SortedList();
             data.Add("dev_name", machineTxt.Text);
             data.Add("pro_name", txtProgram.Text);
             data.Add("batch_num", txtBatch.Text);
             data.Add("object_id", _machineId);
             data.Add("bar_code", _MachineCode);
             HCSWF_device_result_add dialog = new HCSWF_device_result_add(data, pdCodeType);
             dialog.OperationUser           = this.UserInfo;
             dialog.ShowDialog();
         }));
     }
 }
 public void AddSetCheck()
 {
     if (setDataGrid.CurrentRow != null && setDataGrid.CurrentRow.Tag is DataRow)
     {
         this.Invoke(new Action(() => {
             DataRow rowData = setDataGrid.CurrentRow.Tag as DataRow;
             SortedList data = new SortedList();
             data.Add("dev_name", machineTxt.Text);
             data.Add("pro_name", txtProgram.Text);
             data.Add("batch_num", txtBatch.Text);
             data.Add("object_id", (rowData["id"] is DBNull) ? string.Empty : rowData["id"].ToString());
             data.Add("bar_code", (rowData["bar_code"] is DBNull) ? string.Empty : rowData["bar_code"].ToString());
             data.Add("set_name", (rowData["ca_name"] is DBNull) ? string.Empty : rowData["ca_name"].ToString());
             data.Add("set_priorty", (rowData["pa_priorty"] is DBNull) ? string.Empty : rowData["pa_priorty"].ToString());
             HCSWF_device_result_add dialog = new HCSWF_device_result_add(data, 3);
             dialog.OperationUser           = this.UserInfo;
             dialog.ShowDialog();
         }));
     }
     else
     {
         MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }