/// <summary> /// метод добавляет нового субподрядчика /// </summary> /// <param name="path"></param> public void AddSubcontractor(string path, string name) { SubcontrWorkFile newSubcontractor = new SubcontrWorkFile(); newSubcontractor.Path = Path.Combine(ReportPath, SubcontractorFolderName, findFullName(path)); newSubcontractor.worker.Name = name; foreach (SubcontrWorkFile temp in Subcontractors) { if (temp.Path == newSubcontractor.Path) { File.Delete(temp.Path); } } File.Copy(path, newSubcontractor.Path); Subcontractors.Add(newSubcontractor); }
public void OpenProject(string name) { ReportPath = Path.Combine(CurrentReportPath, name); DirectoryInfo contrInfo = new DirectoryInfo(Path.Combine(ReportPath, ContractorFolderName)); FileInfo[] contr = contrInfo.GetFiles(); Contractor.Path = Path.Combine(ReportPath, ContractorFolderName, contr[0].Name); DirectoryInfo subcontrInfo = new DirectoryInfo(Path.Combine(ReportPath, SubcontractorFolderName)); foreach (FileInfo temp in subcontrInfo.GetFiles()) { Subcontractors.Add(new SubcontrWorkFile() { Path = Path.Combine(ReportPath, SubcontractorFolderName, temp.Name) }); } }