Exemplo n.º 1
0
        private void txtCheckListName_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            using (EquipmentCommonQueryDialog queryDialog = new EquipmentCommonQueryDialog("EquipmentCheckList", false))
            {
                if (queryDialog.ShowDialog() == DialogResult.OK)
                {
                    if (queryDialog.SelectedData != null && queryDialog.SelectedData.Length > 0)
                    {
                        DataRow selectedRow = queryDialog.SelectedData[0];

                        this.txtCheckListName.Text = selectedRow[EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_NAME].ToString();
                        this.txtCheckListName.Tag  = selectedRow[EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_KEY].ToString();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (EquipmentCommonQueryDialog queryDialog = new EquipmentCommonQueryDialog("EquipmentCheckItems", true))
            {
                if (queryDialog.ShowDialog() == DialogResult.OK)
                {
                    if (queryDialog.SelectedData != null && queryDialog.SelectedData.Length > 0)
                    {
                        DataTable dataTable = this.grdCheckListItemsList.DataSource as DataTable;

                        if (dataTable != null)
                        {
                            foreach (DataRow selectedRow in queryDialog.SelectedData)
                            {
                                string checkItemName = selectedRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_NAME].ToString();

                                if (dataTable.Select(string.Format("{0} = '{1}'", EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_NAME, checkItemName)).Length <= 0)
                                {
                                    DataRow dataRow = dataTable.NewRow();

                                    dataRow[EMS_CHECKLIST_ITEM_FIELDS.FIELD_CHECKITEM_KEY] = selectedRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_KEY];
                                    dataRow[EMS_CHECKLIST_ITEM_FIELDS.FIELD_SEQUENCE]      = dataTable.Rows.Count + 1;
                                    dataRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_NAME]    = selectedRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_NAME];
                                    dataRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_TYPE]    = selectedRow[EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_TYPE];
                                    dataRow[EMS_CHECKITEMS_FIELDS.FIELD_DESCRIPTION]       = selectedRow[EMS_CHECKITEMS_FIELDS.FIELD_DESCRIPTION];
                                    dataRow[EMS_CHECKLIST_ITEM_FIELDS.FIELD_STANDARD]      = string.Empty;
                                    dataRow[EMS_CHECKLIST_ITEM_FIELDS.FIELD_OPTIONAL]      = 0;

                                    dataTable.Rows.Add(dataRow);
                                }
                            }

                            this.grvCheckListItemsList.BestFitColumns();
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 导入布局图
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            using (EquipmentCommonQueryDialog queryDialog = new EquipmentCommonQueryDialog("EquipmentLayout", false))
            {
                if (queryDialog.ShowDialog() == DialogResult.OK)
                {
                    if (queryDialog.SelectedData != null && queryDialog.SelectedData.Length > 0)
                    {
                        DataRow selectedRow = queryDialog.SelectedData[0];
                        equLayoutKey         = selectedRow[EMS_LAYOUT_MAIN_FIELDS.LAYOUT_KEY].ToString();
                        this.txtPicName.Text = selectedRow[EMS_LAYOUT_MAIN_FIELDS.LAYOUT_NAME].ToString();
                        this.txtPicName.Tag  = equLayoutKey;

                        string  msg;
                        DataSet dsReturn = EquLayoutEntity.GetEquipmentLayoutDetail(equLayoutKey, out msg);
                        if (string.IsNullOrEmpty(msg))
                        {
                            QueryEquipmentData(dsReturn);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void txtCheckListJobName_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button.Kind == ButtonPredefines.Ellipsis)
            {
                using (EquipmentCommonQueryDialog queryDialog = new EquipmentCommonQueryDialog("EquipmentCheckListJob", false))
                {
                    if (queryDialog.ShowDialog() == DialogResult.OK)
                    {
                        if (queryDialog.SelectedData != null && queryDialog.SelectedData.Length > 0)
                        {
                            DataRow selectedRow = queryDialog.SelectedData[0];

                            this.txtCheckListJobName.Text = selectedRow[EMS_CHECKLIST_JOBS_FIELDS.FIELD_CHECKLIST_JOB_NAME].ToString();
                            this.txtCheckListJobName.Tag  = selectedRow[EMS_CHECKLIST_JOBS_FIELDS.FIELD_CHECKLIST_JOB_KEY].ToString();
                        }
                    }
                }
            }
            else if (e.Button.Kind == ButtonPredefines.Delete)
            {
                this.txtCheckListJobName.Text = string.Empty;
                this.txtCheckListJobName.Tag  = string.Empty;
            }
        }