private void btnSave_Click(object sender, EventArgs e) { SqlRecord rec = new SqlRecord(TbRouteLists.Name, TbRouteLists.NameOfList, tbRouteListName.Text); rec.SetField(TbRouteLists.NumberOfOrder, Int32.Parse(tbNumberOfOrder.Text)); rec.SetField(TbRouteLists.CountOfMaterials, Int32.Parse(tbCountOfWafers.Text)); rec.SetField(TbRouteLists.SetOfMasks, cbSetOfMasks.Text); rec.SetField(TbRouteLists.Materials, cbPartyNumber.Text + "_" + cbWaferNumber.Text); rec.SetField(TbRouteLists.Technologist, cbTechnologist.Text); rec.SetField(TbRouteLists.DateOfCreation, dtpTimeOfCreation.Value); rec.Save(); }
private void cbIsLaunched_CheckStateChanged(object sender, EventArgs e) { if (cbIsLaunched.Checked) { cbIsLaunched.Text = "Пластина запущена"; cbIsLaunched.ForeColor = Color.Green; } else { cbIsLaunched.Text = "Пластина не запущена"; cbIsLaunched.ForeColor = Color.Red; } if (_editMode) { SqlRecord rec = new SqlRecord(TbMaterials.Name, TbMaterials.MaterialId, _materialRecordId); rec.SetField(TbMaterials.LaunchedStatus, cbIsLaunched.Checked ? "YES" : "NO"); rec.Save(); } }
private bool RecordOfNewWafers() { List<int> numbers; try { numbers = GetNumbersOfWafers(textBoxWaferNumber.Text); } catch { return false; } // сохранение данных foreach (int i in numbers) { // создаем запись и сохраняем первичные данные SqlRecord record = new SqlRecord(TbMaterials.Name, TbMaterials.MaterialId, String.Format("{0}_{1}", textBoxParcelNumber.Text, i)); if (!record.Exist) { record.SetField(TbMaterials.NumberOfParcel, textBoxParcelNumber.Text); record.SetField(TbMaterials.NumberOfWafer, i); _records.Add(record); } else { _records.Clear(); MessageBox.Show("Одна из указанных пластин уже существует!"); return false; } } textBoxParcelNumber.ReadOnly = true; textBoxWaferNumber.ReadOnly = true; return true; }
private bool CreateEpitStructure() { string nameOfEpitStructureTable = TbEpitStructure.Name(textBoxParcelNumber.Text + "_" + textBoxWaferNumber.Text); // создаем имя структуры string nameForUser = GetEpitStack(); // делаем запись в таблице 'TbEpitHost' SqlRecord recEpitHost = new SqlRecord(TbEpitHost.Name, TbEpitHost.NameOfEpitStructureTable, nameOfEpitStructureTable); recEpitHost.SetField(TbEpitHost.UserName, nameForUser); recEpitHost.SetField(TbEpitHost.TimeOfCreation, DateTime.Now); recEpitHost.Save(); // создаем и заполняем таблицу 'TbEpitStructure' SqlTable tbEpitStruct = new SqlTable(nameOfEpitStructureTable); if (tbEpitStruct.Exist) tbEpitStruct.Remove(); tbEpitStruct.Create(TbEpitStructure.Number, typeof (int)); for (int i = 0; i < dataGridViewLayers.RowCount - 1; i++) { int num = dataGridViewLayers.RowCount - i - 2; SqlRecord recEpitStruct = tbEpitStruct.GetRecord(TbEpitStructure.Number, num); recEpitStruct.CreateFieldsIfNotExist = true; // валидация данных double thickness = 0, conc = 0; double? readThickness = ClientLibrary.DoubleParse(dataGridViewLayers.Rows[i].Cells[3].Value.ToString()), readConc = ClientLibrary.DoubleParse(dataGridViewLayers.Rows[i].Cells[4].Value.ToString()); if (readThickness == null || readConc == null) { tbEpitStruct.Remove(); recEpitHost.Remove(); return false; } thickness = (double) readThickness; conc = (double) readConc; recEpitStruct.SetField(TbEpitStructure.TypeOfLayer, dataGridViewLayers.Rows[i].Cells[1].Value.ToString()); recEpitStruct.SetField(TbEpitStructure.Material, dataGridViewLayers.Rows[i].Cells[2].Value.ToString()); recEpitStruct.SetField(TbEpitStructure.Thickness, thickness); recEpitStruct.SetField(TbEpitStructure.Concentration, conc); recEpitStruct.Save(); } return true; }
private void cbUserValidation_CheckStateChanged(object sender, EventArgs e) { if (cbUserValidation.Checked) { cbUserValidation.Text = "Запись подтверждена"; cbUserValidation.ForeColor = Color.Green; } else { cbUserValidation.Text = "Запись не подтверждена"; cbUserValidation.ForeColor = Color.Red; } if (_editMode) { SqlRecord rec = new SqlRecord(TbMaterials.Name, TbMaterials.MaterialId, _materialRecordId); rec.SetField(TbMaterials.VerificationStatus, cbUserValidation.Checked ? "YES" : "NO"); rec.Save(); } }
String SaveSetOfMasks() { string nameSetOfMasks = ""; // корректно вводим в базу данных id - имя комплекта фотошаблонов switch (buttonSaveMasks.Text) { case "Создать": { if (textBoxNameSetOfMasks.Text == "") return "Вы не ввели информацию о названии комплекта фотошаблонов"; nameSetOfMasks = textBoxNameSetOfMasks.Text; _newRecord = new SqlRecord(TbSetOfMasks.Name, TbSetOfMasks.NameOfSetOfMasksId, nameSetOfMasks); if (_newRecord.Exist) return "Указанный комплект фотошаблонов уже существует"; _tbMasks = new SqlTable(TbMasks.GetName(nameSetOfMasks)); CreateSetOfMaskTable(); break; } case "Cохранить": { if (textBoxNameSetOfMasks.Text == "") return "Вы не ввели информацию о названии комплекта фотошаблонов"; nameSetOfMasks = textBoxNameSetOfMasks.Text; _newRecord.Remove(); _newRecord = new SqlRecord(TbSetOfMasks.Name, TbSetOfMasks.NameOfSetOfMasksId, nameSetOfMasks); if (_newRecord.Exist) return "Указанный комплект фотошаблонов уже существует"; _tbMasks.Remove(); _tbMasks = new SqlTable(TbMasks.GetName(nameSetOfMasks)); CreateSetOfMaskTable(); break; } } // если выбраны файлы и папки, то заливаем их в БД if (_pathToTtWord != "") { string fileId = GetFileID(textBoxTTWord.Text, nameSetOfMasks + " @ TT_word"); ClientLibrary.UploadFileToServer(_pathToTtWord, fileId); _newRecord.SetField(TbSetOfMasks.RecordIdofTrWordFile, fileId); } if (_pathToTtScan != "") { string fileId = GetFileID(textBoxTTScan.Text, nameSetOfMasks + " @ TT_scan"); ClientLibrary.UploadFileToServer(_pathToTtScan, fileId); _newRecord.SetField(TbSetOfMasks.RecordIdofTrScanFile, fileId); } if (_pathToMap != "") { string fileId = GetFileID(textBoxMap.Text, nameSetOfMasks + " @ TT_map"); ClientLibrary.UploadFileToServer(_pathToMap, fileId); _newRecord.SetField(TbSetOfMasks.RecordIdOfMapFile, fileId); } if (_pathToAttachedFile != "") { string fileId = GetFileID(textBoxAttachedFile.Text, nameSetOfMasks + " @ attached_file"); ClientLibrary.UploadFileToServer(_pathToAttachedFile, fileId); _newRecord.SetField(TbSetOfMasks.RecordIdOfAttachedFile, fileId); } // архивация папки и загрузка архива в БД if (_pathToFolderWithMasks != "") { string programFolder = Path.GetDirectoryName(Application.ExecutablePath); string pathToSaveFolder = String.Format("{0}\\cache {1}", programFolder, ClientLibrary.GetAuthorOfComputer()); string destination = pathToSaveFolder + "\\" + Path.GetFileName(_pathToFolderWithMasks) + ".zip"; FileInfo fi = new FileInfo(destination); if (fi.Exists) fi.Delete(); ZipFile.CreateFromDirectory(_pathToFolderWithMasks, destination, CompressionLevel.NoCompression, false, Encoding.UTF8); string fileId = GetFileID(textBoxFolderWithMasks.Text, nameSetOfMasks + " @ folder_masks") + ".zip"; ClientLibrary.UploadFileToServer(destination, fileId); _newRecord.SetField(TbSetOfMasks.RecordIdOfFolderWithMasks, fileId); } // вводим в базу данных остальную информацию _newRecord.SetField(TbSetOfMasks.Description, richTextBoxComment.Text); _newRecord.SetField(TbSetOfMasks.Technology, comboBoxTechnology.Text); _newRecord.SetField(TbSetOfMasks.TimeOfRecordCreation, dateTimePickerRecordSetOfMasks.Value); _newRecord.SetField(TbSetOfMasks.Developer, comboBoxDeveloper.Text); _newRecord.SetField(TbSetOfMasks.Author, cbAuthor.Text); _newRecord.SetField(TbSetOfMasks.NameOfTableWithMasks, TbMasks.GetName(nameSetOfMasks)); _newRecord.SetField(TbSetOfMasks.TechProc, cbTechProc.Text); _newRecord.SetField(TbSetOfMasks.TimeOfSetOfMasksCreation, dtpTimeOfSetOfMasksCreation.Value); _newRecord.Save(); return "correct"; }