private void DoubleClickViolation(Point point) { if (_dgvMain.GetID() == 0) { return; } ViolationList violationList = ViolationList.getInstance(); Violation violation = violationList.getItem(_dgvMain.GetID()); if ((_dgvCar.Columns[point.X].HeaderText == "№ постановления") && (!string.IsNullOrEmpty(violation.File))) { WorkWithFiles.openFile(violation.File); } else if ((_dgvCar.Columns[point.X].HeaderText == "Дата оплаты") && (!string.IsNullOrEmpty(violation.FilePay))) { WorkWithFiles.openFile(violation.FilePay); } else { Violation_AddEdit vAE = new Violation_AddEdit(violation); if (vAE.ShowDialog() == DialogResult.OK) { loadCars(); } } }
protected void DeleteFile(string newFile) { if ((_fileBegin != string.Empty) && (_fileBegin != newFile)) { WorkWithFiles.Delete(_fileBegin); } }
protected void DeleteFile(string newFile) { if (FileBegin != string.Empty && FileBegin != newFile) { WorkWithFiles.Delete(FileBegin); } }
protected void deleteFilePay() { if ((_fileBeginPay != string.Empty) && (_fileBeginPay != FilePay)) { WorkWithFiles.Delete(_fileBeginPay); } }
static void Main() { Console.Write("Введите диапазон значений x по образцу (0 10): "); double[] rangeX = ReadInput(); Console.Write("Введите шаг построения функции: "); double[] step = ReadInput(); string path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); string inputFile = @"\input.txt"; string outputFile = @"\output.txt"; WorkWithFiles workWithFiles = new WorkWithFiles(); if (!File.Exists(path + inputFile)) { workWithFiles.WriteTextToFile(path, inputFile, "log(15^x^x - 25,5 + 5! * 43 - (7 * 5)) * cos(5) - 1"); } ReversePolishNotation reversePolishNotation = new ReversePolishNotation(); List <string> textExpression = workWithFiles.ReadTextFromFile(path, inputFile); List <object> parseExpression = reversePolishNotation.Parse(textExpression); foreach (var item in parseExpression) { Console.WriteLine(item); } ; TableOfFunctionValues tableOfFunctionValues = new TableOfFunctionValues(); string finalText = tableOfFunctionValues.CreatingTable(rangeX, step[1], parseExpression); workWithFiles.WriteTextToFile(path, outputFile, finalText); }
private void DoubleClickSale(Point point) { Car car = _dgvMain.GetCar(); if (car == null) { return; } PTSList ptsList = PTSList.getInstance(); PTS pts = ptsList.getItem(car); STSList stsList = STSList.getInstance(); STS sts = stsList.getItem(car); if ((_dgvCar.Columns[point.X].HeaderText == "№ ПТС") && (!string.IsNullOrEmpty(pts.File))) { WorkWithFiles.openFile(pts.File); } else if ((_dgvCar.Columns[point.X].HeaderText == "№ СТС") && (!string.IsNullOrEmpty(sts.File))) { WorkWithFiles.openFile(sts.File); } else { CarSaleList carSaleList = CarSaleList.getInstance(); CarSale carSale = carSaleList.getItem(car.ID); Car_Sale carSaleForm = new Car_Sale(carSale); if (carSaleForm.ShowDialog() == DialogResult.OK) { loadCars(); } } }
private void DoubleClickPolicy(Point point) { if (_dgvMain.GetID() == 0) { return; } PolicyList policyList = PolicyList.getInstance(); Policy policy = policyList.getItem(_dgvMain.GetID()); string columnName = _dgvCar.Columns[point.X].HeaderText; if ((_dgvCar.Columns[point.X].HeaderText == "Номер полиса") && (!string.IsNullOrEmpty(policy.File))) { WorkWithFiles.openFile(policy.File); } else if (DGVSpecialColumn.CanFiltredPolicy(columnName)) // (labelList.Where(item => item.Text == columnName).Count() == 1) { _myFilter.SetFilterValue(string.Concat(columnName, ":"), point); } else { Policy_AddEdit policyAE = new Policy_AddEdit(policy); if (policyAE.ShowDialog() == DialogResult.OK) { loadCars(); } } }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "cars", Car.ID, "Invoices", Number); ID = Convert.ToInt32(_provider.Insert("Invoice", ID, Car.ID, Number, DriverFromID, DriverToID, Date, DateMoveForSQL, RegionFromID, RegionToID, File)); }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "cars", Car.ID, "DiagCard", Number); ExecSave(); }
private void SaveFile1_Click(object sender, EventArgs e) { if (SaveFileDialog.ShowDialog() == DialogResult.OK) { WorkWithFiles file = new WorkWithFiles(); file.WriteTo(SaveFileDialog.FileName, TextBox1.Lines); } }
private void DoubleClickAccount(Point point) { try { if (_dgvMain.GetID() == 0) { return; } AccountList accountListList = AccountList.getInstance(); Account account = accountListList.getItem(_dgvMain.GetID()); if ((_dgvCar.Columns[point.X].HeaderText == "Файл") && (!string.IsNullOrEmpty(account.File))) { WorkWithFiles.openFile(account.File); } else if (_dgvCar.Columns[point.X].HeaderText == "Номер счёта") { GotoPagePolicy(account); } else if ((_dgvCar.Columns[point.X].HeaderText == "Согласование") && (account.CanAgree())) { if (account.File == string.Empty) { throw new NotImplementedException("Для согласования необходимо прикрепить скан копию счёта"); } else if ((User.GetRole() == RolesList.Boss) || (User.GetRole() == RolesList.Adminstrator)) { account.Agree(); loadCars(); } else { throw new AccessViolationException("Вы не имеете прав на выполнение этой операции"); } } else { Account_AddEdit accountAE = new Account_AddEdit(account); if (accountAE.ShowDialog() == DialogResult.OK) { loadCars(); } } } catch (NotImplementedException ex) { MessageBox.Show(ex.Message, "Ошибка отправки", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (NullReferenceException ex) { MessageBox.Show(ex.Message, "Ошибка отправки", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (AccessViolationException ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void WhenITakeAScreenshot() { string BbcScreenShotsFolderPath = ConfigurationManager.AppSettings["ScreenShotsFolderPath"]; WorkWithFiles WorkWithFiles = new WorkWithFiles(); WorkWithFiles.CreateFolderIfNotCreated(BbcScreenShotsFolderPath); WorkWithFiles.ClearFolder(BbcScreenShotsFolderPath); WorkWithFiles.GetScreenshot(BbcScreenShotsFolderPath, $"{WorkWithFiles.GetNumberOfFolderFiles(BbcScreenShotsFolderPath) + 1}"); }
private void DownloadFile2_Click(object sender, EventArgs e) { if (OpenFileDialog2.ShowDialog() == DialogResult.OK) { WorkWithFiles file = new WorkWithFiles(OpenFileDialog2.FileName); TextBox2.Lines = file.Text; OpenFileDialog2.Dispose(); } }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "drivers", Driver.ID, "MedicalCert", Number); ExecSave(); MedicalCertList.getInstance().Add(this); }
public static void GetScreenShootOfFailedTest() { if (TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Failed) { string folderPath = ConfigurationManager.AppSettings["ScreenShotsOfFailedTestsFolderPath"]; WorkWithFiles WorkWithFiles = new WorkWithFiles(); WorkWithFiles.CreateFolderIfNotCreated(folderPath); WorkWithFiles.GetScreenshot(folderPath, $"{ScenarioContext.Current.ScenarioInfo.Title} {DateTime.Now.ToString("yyyy_MM_dd")}"); } }
private void tryOpenFile(string fileName) { try { WorkWithFiles.openFile(fileName); } catch (Exception ex) { MessageBox.Show(ex.Message, "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "cars", Car.ID, "ShipPart", Number); int id; int.TryParse(_provider.Insert("ShipPart", ID, Car.ID, Driver.ID, Number, DateRequestForSQL, DateSentForSQL, File).ToString(), out id); ID = id; }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "cars", Car.ID, "Documents", Name); int id; int.TryParse(_provider.Insert("CarDoc", ID, Car.ID, Name, File), out id); ID = id; }
private void driverLicenseToolStripMenuItem_Click(object sender, EventArgs e) { DTP dtp = _dtpList.getItem(Convert.ToInt32(_dgvDTP.Rows[_dgvDTP.SelectedCells[0].RowIndex].Cells[0].Value)); Driver driver = _driverCarList.GetDriver(dtp.Car, dtp.Date); LicenseList licencesList = LicenseList.getInstance(); DriverLicense driverLicense = licencesList.getItem(driver); WorkWithFiles.OpenFile(driverLicense.File); }
public override void Save() { DeleteFile(File); File = WorkWithFiles.FileCopyById(File, "cars", Car.Id, "Documents", Name); int id; int.TryParse(Provider.Insert("CarDoc", Id, Car.Id, Name, File), out id); Id = id; }
private void sTSToolStripMenuItem_Click(object sender, EventArgs e) { try { WorkWithFiles.OpenFile(_sts.File); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tryOpenFile(string file) { try { WorkWithFiles.openFile(file); } catch (Exception ex) { MessageBox.Show(ex.Message, "Не найден файл", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public override void Save() { DeleteFile(File); File = WorkWithFiles.FileCopyById(File, "cars", Car.Id, "", "STS"); Provider.Insert("STS", Car.Id, Number, Date, GiveOrg, File); STSList stsList = STSList.getInstance(); stsList.Add(this); }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "drivers", Driver.ID, "DriverLicense", Number); ExecSave(); LicenseList licenseList = LicenseList.getInstance(); licenseList.Add(this); }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "cars", Car.ID, "", "PTS"); _provider.Insert("PTS", Car.ID, Number, Date, GiveOrg, File); PTSList ptsList = PTSList.getInstance(); ptsList.Add(this); }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "drivers", Driver.ID, "Instraction", Name); ID = Convert.ToInt32(_provider.Insert("Instraction", ID, Driver.ID, Name, date, File)); InstractionList instractionList = InstractionList.getInstance(); instractionList.Add(this); }
private void kaskoToolStripMenuItem_Click(object sender, EventArgs e) { try { Policy policy = _policyList.getItem(_car, PolicyType.КАСКО); WorkWithFiles.OpenFile(policy.File); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public override void Save() { DeleteFile(File); File = WorkWithFiles.fileCopyByID(File, "drivers", Driver.ID, "Passports", _number); int id; int.TryParse(_provider.Insert("Passport", ID, Driver.ID, LastName, FirstName, SecondName, Number, GiveOrg, GiveDate, Address, File), out id); ID = id; PassportList.getInstance().Add(this); }
private void pic_Click(object sender, EventArgs e) { PictureBox pic = sender as PictureBox; if ((pic.Name == "picPTS") && (!string.IsNullOrEmpty(_pts.File))) { WorkWithFiles.OpenFile(_pts.File); } else if ((pic.Name == "picSTS") && (!string.IsNullOrEmpty(_sts.File))) { WorkWithFiles.OpenFile(_sts.File); } }
public SearchWindow(WorkWithFiles files, bool blockType, MainWindow mWindow) { WindowStartupLocation = WindowStartupLocation.CenterScreen; OpenWindow = true; _files = files; _blocktype = blockType; InitializeComponent(); _tempSear4 = false; _freqSear4 = false; _form = mWindow; GetAccesRule(); //if (_blocktype) //{ // F0Label.Foreground = Brushes.Green; // FhData.IsReadOnly = false; // Ks1Label.Foreground = Brushes.Green; // Ks1Data.IsReadOnly = false; // Ks2Label.Foreground = Brushes.Green; // Ks2Data.IsReadOnly = false; // Ks1_10Label.Foreground = Brushes.Green; // Ks1_10Data.IsReadOnly = false; // Ks2_10Label.Foreground = Brushes.Green; // Ks2_10Data.IsReadOnly = false; // GetLabel.Foreground = Brushes.Red; // GetData.IsReadOnly = true; // Get_6Label.Foreground = Brushes.Red; // Get_6Data.IsReadOnly = true; //} //else //{ // F0Label.Foreground = Brushes.Red; // FhData.IsReadOnly = true; // Ks1Label.Foreground = Brushes.Red; // Ks1Data.IsReadOnly = true; // Ks2Label.Foreground = Brushes.Red; // Ks2Data.IsReadOnly = true; // Ks1_10Label.Foreground = Brushes.Red; // Ks1_10Data.IsReadOnly = true; // Ks2_10Label.Foreground = Brushes.Red; // Ks2_10Data.IsReadOnly = true; // GetLabel.Foreground = Brushes.Green; // GetData.IsReadOnly = false; // Get_6Label.Foreground = Brushes.Green; // Get_6Data.IsReadOnly = false; //} //DataFromFile.SelectionUnit = DataGridSelectionUnit.Cell; }