コード例 #1
0
        public void LoadEpitTableToDataGrid(String table, DataGridView dgv)
        {
            SqlSelect sqlSelect = new SqlSelect(table);
            sqlSelect.OrderByField = TbEpitStructure.Number;
            sqlSelect.SortIsAscending = false;
            sqlSelect.RetrieveData();

            dgv.Rows.Clear();
            dgv.RowCount = sqlSelect.CountOfRows + 1;

            for (int i = 0; i < sqlSelect.CountOfRows; i++)
            {
                int number = (int)sqlSelect.GetValueOfField(TbEpitStructure.Number, i);
                dgv.Rows[i].Cells[0].Value = number != 0 ? number + " слой" : "Подложка";
                dgv.Rows[i].Cells[1].Value = sqlSelect.GetValueOfField(TbEpitStructure.TypeOfLayer, i);
                dgv.Rows[i].Cells[2].Value = sqlSelect.GetValueOfField(TbEpitStructure.Material, i);
                dgv.Rows[i].Cells[3].Value = sqlSelect.GetValueOfField(TbEpitStructure.Thickness, i) + "?";
                dgv.Rows[i].Cells[4].Value =
                    ((double)sqlSelect.GetValueOfField(TbEpitStructure.Concentration, i)).ToString("0.0##E+00") + "?";
            }
        }
コード例 #2
0
        public static string GetAuthorOfComputer()
        {
            string author = "";

            List<string> macAddresses = GetMacAddressOfCurrentComputer();
            foreach (string macAddress in macAddresses)
            {
                SqlSelect sqlSelect = new SqlSelect(TbPeopleHardwareAddress.Name);
                sqlSelect.Like(TbPeopleHardwareAddress.MacAddress, macAddress);
                sqlSelect.RetrieveData();

                if (sqlSelect.CountOfRows == 1)
                {
                    author = sqlSelect.GetValueOfField(TbPeopleHardwareAddress.SurnameAndName).ToString();
                    break;
                }
            }

            return author != "" ? author : macAddresses[0];
        }
コード例 #3
0
        private void InitDgvEpitStructure()
        {
            dgvEpitStructure.ColumnCount = _nameOfColumns.Length;
            for (int i = 0; i < _nameOfColumns.Length; i++)
                dgvEpitStructure.Columns[i].Name = _nameOfColumns[i];
            dgvEpitStructure.ReadOnly = true;
            dgvEpitStructure.Font = new Font("Microsoft Sans Serif", 8);
            dgvEpitStructure.ColumnHeadersDefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8);
            dgvEpitStructure.BackgroundColor = SystemColors.Control;
            dgvEpitStructure.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dgvEpitStructure.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvEpitStructure.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            string nameOfTableWithEpitStructure = (string) _currSqlSelect.GetValueOfField(TbMaterials.NameOfTableWithEpitStructure);
            SqlSelect sqlSelect = new SqlSelect(nameOfTableWithEpitStructure)
            {
                OrderByField = TbEpitStructure.Number,
                SortIsAscending = false
            };
            sqlSelect.RetrieveData();

            dgvEpitStructure.RowCount = sqlSelect.CountOfRows + 1;
            for (int i = 0; i < sqlSelect.CountOfRows; i++)
            {
                for (int col = 0; col < _nameOfColumns.Length; col++)
                {
                    string res = sqlSelect.GetValueOfField(_indexOfColumns[col], i).ToString();
                    if (col == 4)
                        res = ((double) sqlSelect.GetValueOfField(_indexOfColumns[col], i)).ToString("0.0##E+00");
                    if (col == 0 && res == "0")
                        res = "Подложка";

                    dgvEpitStructure.Rows[i].Cells[col].Value = res;
                }
            }

            dgvEpitStructure.AutoResizeColumns();
        }
コード例 #4
0
        private void ConstructFormWithValue()
        {
            tbPartyNumber.Text = _currSqlSelect.GetValueOfField(TbMaterials.NumberOfParcel).ToString();
            tbWaferNumber.Text = _currSqlSelect.GetValueOfField(TbMaterials.NumberOfWafer).ToString();
            rtbComment.Text = _currSqlSelect.GetValueOfField(TbMaterials.Comment).ToString();
            cbAuthor.Text = _currSqlSelect.GetValueOfField(TbMaterials.AuthorOfRecord).ToString();
            cbTechnology.Text = _currSqlSelect.GetValueOfField(TbMaterials.Technology).ToString();
            tbIngot.Text = _currSqlSelect.GetValueOfField(TbMaterials.Ingot).ToString();
            tbCorrespond.Text =  _currSqlSelect.GetValueOfField(TbMaterials.Corresponds).ToString();
            cbWaferManufacturer.Text = _currSqlSelect.GetValueOfField(TbMaterials.WaferManufacturer).ToString();
            cbMaterialOfWafer.Text = _currSqlSelect.GetValueOfField(TbMaterials.MaterialOfWafer).ToString();
            cbTypeOfWafer.Text = _currSqlSelect.GetValueOfField(TbMaterials.TypeOfWafer).ToString();
            tbConcOfWafer.Text = _currSqlSelect.GetValueOfField(TbMaterials.ConcentrationInWafer).ToString();
            tbThickOfWafer.Text =  _currSqlSelect.GetValueOfField(TbMaterials.ThicknessOfWafer).ToString();
            dtpRecordMaterial.Value = (DateTime) _currSqlSelect.GetValueOfField(TbMaterials.CreationDate);
            cbManufacturer.Text =  _currSqlSelect.GetValueOfField(TbMaterials.StructureManufacturer).ToString();

            string strResistance =  _currSqlSelect.GetValueOfField(TbMaterials.WaferResistance).ToString();
            if (strResistance != "")
            {
                double resistance = Double.Parse(strResistance);
                cbWaferResistance.Text = resistance.ToString("0.0##E+00");
            }

            cbWaferDiameter.Text =  _currSqlSelect.GetValueOfField(TbMaterials.WaferDiameter).ToString();
            cbTechProc.Text =  _currSqlSelect.GetValueOfField(TbMaterials.TechProc).ToString();

            // получение стека эпитаксиальных структур
            string nameOfTableWithEpitStructure =  _currSqlSelect.GetValueOfField(TbMaterials.NameOfTableWithEpitStructure).ToString();
            SqlSelect sqlSelect = new SqlSelect(TbEpitHost.Name);
            sqlSelect.Equal(TbEpitHost.NameOfEpitStructureTable, nameOfTableWithEpitStructure);
            sqlSelect.RetrieveData();
            tbTypeOfEpitStruct.Text = sqlSelect.GetValueOfField(TbEpitHost.UserName).ToString();

            InitDgvEpitStructure();

            // обновляем контролы без изменения БД
            bool copy = _editMode;
            _editMode = false;
            string userValidation = _currSqlSelect.GetValueOfField(TbMaterials.VerificationStatus).ToString();
            cbUserValidation.CheckState = userValidation == "YES" ? CheckState.Checked : CheckState.Unchecked;
            string isLaunched = _currSqlSelect.GetValueOfField(TbMaterials.LaunchedStatus).ToString();
            cbIsLaunched.CheckState = isLaunched == "YES" ? CheckState.Checked : CheckState.Unchecked;
            _editMode = copy;

            string recordIdOfEpitStructureFile =  _currSqlSelect.GetValueOfField(TbMaterials.RecordIdOfEpitStructureFile).ToString();
            if (recordIdOfEpitStructureFile != "")
            {
                SqlSelect select1 = new SqlSelect(TbFilesPool.Name);
                select1.Equal(TbFilesPool.FileID, recordIdOfEpitStructureFile);
                select1.RetrieveData();
                lblOpenScanOfPassFile.Text = select1.GetValueOfField(TbFilesPool.NameOfFile).ToString();
                _pathToScanPassFile = ClientLibrary.DownloadFileFromServer(recordIdOfEpitStructureFile);
                if (_pathToScanPassFile != null)
                    pbEpitStructImage.Load(_pathToScanPassFile);
            }

            string recordIdOfAttachmentFile = _currSqlSelect.GetValueOfField(TbMaterials.RecordIdOfAttachmentFile).ToString();
            if (recordIdOfAttachmentFile != "")
            {
                SqlSelect select2 = new SqlSelect(TbFilesPool.Name);
                select2.Equal(TbFilesPool.FileID, recordIdOfAttachmentFile);
                select2.RetrieveData();
                lblOpenAttFile.Text = select2.GetValueOfField(TbFilesPool.NameOfFile).ToString();
                _pathToAttFile = ClientLibrary.DownloadFileFromServer(recordIdOfAttachmentFile);
            }

            MakeControlsReadOnly();
        }