public void SetMaterialId(string id) { _materialRecordId = id; _currSqlSelect = new SqlSelect(TbMaterials.Name); _currSqlSelect.Equal(TbMaterials.MaterialId, id); _currSqlSelect.RetrieveData(); ConstructFormWithValue(); }
private void ConstructSelectQuery(ref SqlSelect sqlSelectQuery) { if (tbGlobalSearch.Text != "") { string str = tbGlobalSearch.Text; sqlSelectQuery.TypeOfLogicIsAnd = false; sqlSelectQuery.Like(TbMaterials.MaterialId, str); sqlSelectQuery.Like(TbMaterials.AuthorOfRecord, str); sqlSelectQuery.Like(TbMaterials.Comment, str); sqlSelectQuery.Like(TbMaterials.ConcentrationInWafer, str); sqlSelectQuery.Like(TbMaterials.Corresponds, str); sqlSelectQuery.Like(TbMaterials.CreationDate, str); sqlSelectQuery.Like(TbMaterials.Ingot, str); sqlSelectQuery.Like(TbMaterials.LaunchedStatus, str); sqlSelectQuery.Like(TbMaterials.MaterialOfWafer, str); sqlSelectQuery.Like(TbMaterials.RecordIdOfAttachmentFile, str); sqlSelectQuery.Like(TbMaterials.RecordIdOfEpitStructureFile, str); sqlSelectQuery.Like(TbMaterials.Technology, str); sqlSelectQuery.Like(TbMaterials.TechProc, str); sqlSelectQuery.Like(TbMaterials.StructureManufacturer, str); sqlSelectQuery.Like(TbMaterials.ThicknessOfWafer, str); sqlSelectQuery.Like(TbMaterials.TypeOfWafer, str); sqlSelectQuery.Like(TbMaterials.VerificationStatus, str); sqlSelectQuery.Like(TbMaterials.WaferDiameter, str); sqlSelectQuery.Like(TbMaterials.WaferManufacturer, str); sqlSelectQuery.Like(TbMaterials.WaferResistance, str); return; } if (tbNumberOfParty.Text != "") sqlSelectQuery.Equal(TbMaterials.NumberOfParcel, tbNumberOfParty.Text); if (!rbDontWantWNFilter.Checked) { if (tbNumberOfWafers.Enabled) { int x = Int32.Parse(tbNumberOfWafers.Text); sqlSelectQuery.Equal(TbMaterials.NumberOfWafer, x); } if (tbNumberOfWafersStart.Enabled) { int x1 = Int32.Parse(tbNumberOfWafersStart.Text); sqlSelectQuery.MoreOrEqual(TbMaterials.NumberOfWafer, x1); } if (tbNumberOfWafersFinish.Enabled) { int x2 = Int32.Parse(tbNumberOfWafersFinish.Text); sqlSelectQuery.LessOrEqual(TbMaterials.NumberOfWafer, x2); } } if (!rbDontWantDateFilter.Checked) { if (dtpCreationTime.Enabled) sqlSelectQuery.Equal(TbMaterials.CreationDate, dtpCreationTime.Value.Date); if (dtpCreationStart.Enabled) sqlSelectQuery.MoreOrEqual(TbMaterials.CreationDate, dtpCreationStart.Value.Date); if (dtpCreationFinish.Enabled) sqlSelectQuery.LessOrEqual(TbMaterials.CreationDate, dtpCreationFinish.Value.Date); } if (cbAuthorOfRecord.Text != "") sqlSelectQuery.Equal(TbMaterials.AuthorOfRecord, cbAuthorOfRecord.Text); if (cbDefinitionOfWafer.Text != "") sqlSelectQuery.Equal(TbMaterials.WaferManufacturer, cbDefinitionOfWafer.Text); if (cbTypeOfWafer.Text != "") sqlSelectQuery.Equal(TbMaterials.TypeOfWafer, cbTypeOfWafer.Text); if (cbMaterialOfWafer.Text != "") sqlSelectQuery.Equal(TbMaterials.MaterialOfWafer, cbMaterialOfWafer.Text); if (!rbDontWantConcFilter.Checked) { if (tbConcOfWafer.Enabled) sqlSelectQuery.Equal(TbMaterials.ConcentrationInWafer, Double.Parse(tbConcOfWafer.Text)); if (tbConcOfWaferStart.Enabled) sqlSelectQuery.MoreOrEqual(TbMaterials.ConcentrationInWafer, Double.Parse(tbConcOfWaferStart.Text)); if (tbConcOfWaferFinish.Enabled) sqlSelectQuery.LessOrEqual(TbMaterials.ConcentrationInWafer, Double.Parse(tbConcOfWaferFinish.Text)); } if (!rbDontWantWTFilter.Checked) { if (tbThicknessOfWafer.Enabled) { double thickness = Double.Parse(tbThicknessOfWafer.Text); if (cbWaferThicknessDim.Text == "нм") thickness /= 1000; sqlSelectQuery.Equal(TbMaterials.ThicknessOfWafer, thickness); } if (tbThicknessOfWaferStart.Enabled) { double thickness = Double.Parse(tbThicknessOfWaferStart.Text); if (cbWaferThicknessDimStart.Text == "нм") thickness /= 1000; sqlSelectQuery.MoreOrEqual(TbMaterials.ThicknessOfWafer, thickness); } if (tbThicknessOfWaferFinish.Enabled) { double thickness = Double.Parse(tbThicknessOfWaferFinish.Text); if (cbWaferThicknessDimFinish.Text == "нм") thickness /= 1000; sqlSelectQuery.LessOrEqual(TbMaterials.ThicknessOfWafer, thickness); } } if (!rbStatusAll.Checked) { if (rbStatusLaunched.Checked) sqlSelectQuery.Equal(TbMaterials.LaunchedStatus, "YES"); if (rbStatusNoLaunched.Checked) sqlSelectQuery.Equal(TbMaterials.LaunchedStatus, "NO"); } if (cbTechnology.Text != "") { sqlSelectQuery.Equal(TbMaterials.Technology, cbTechnology.Text); } if (cbTechProc.Text != "") { sqlSelectQuery.Equal(TbMaterials.TechProc, cbTechProc.Text); } if (cbManufacturer.Text != "") { sqlSelectQuery.Equal(TbMaterials.StructureManufacturer, cbManufacturer.Text); } if (tbIngot.Text != "") { sqlSelectQuery.Equal(TbMaterials.Ingot, tbIngot.Text); } if (tbCorresponds.Text != "") { sqlSelectQuery.Equal(TbMaterials.Corresponds, tbCorresponds.Text); } }
private void cbPartyNumber_TextChanged(object sender, EventArgs e) { SqlSelect sqlSelect = new SqlSelect(TbMaterials.Name); sqlSelect.Equal(TbMaterials.NumberOfParcel, cbPartyNumber.Text); sqlSelect.RetrieveData(); DataTable dt = sqlSelect.DataTable; cbWaferNumber.Text = ""; cbWaferNumber.Items.Clear(); var query = from DataRow row in dt.Rows select row[TbMaterials.NumberOfWafer].ToString(); cbWaferNumber.Items.AddRange( query.ToArray() ); }
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(); }