private void frmQuerKalculation_Load(object sender, EventArgs e) { try { if (objBGAEB == null) { objBGAEB = new BGAEB(); } DataTable dtLVSection = new DataTable(); dtLVSection = objBGAEB.GetLVSection(ProjectID); if (Utility.LVSectionEditAccess == "7") { DataTable dttemp = dtLVSection.Copy(); DataView dv = dttemp.DefaultView; dv.RowFilter = "LVSectionName = 'HA'"; dtLVSection = new DataTable(); dtLVSection = dv.ToTable(); } cmbLVSection.Properties.DataSource = dtLVSection; cmbLVSection.Properties.DisplayMember = "LVSectionName"; cmbLVSection.Properties.ValueMember = "LVSectionID"; Utility.SetCheckedComboexitValue(cmbLVSection, "HA"); } catch (Exception ex) {} }
private void btnSave_Click(object sender, EventArgs e) { try { SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false); SplashScreenManager.Default.SetWaitFormDescription("Importieren..."); BGAEB ObjBGAEB = new BGAEB(); ObjEGAEB.ProjectNumber = txtProjectNumber.Text; ObjEGAEB.ProjectDescription = txtProjectDescription.Text; int Ivalue = 0; if (int.TryParse(txtLVSprunge.Text, out Ivalue)) { ObjEGAEB.LVSprunge = Ivalue; } else { ObjEGAEB.LVSprunge = Ivalue; } ObjEGAEB.IsSave = true; ObjBGAEB.SaveeProject(ObjEGAEB); SplashScreenManager.CloseForm(false); this.Close(); } catch (Exception ex) { SplashScreenManager.CloseForm(false); Utility.ShowError(ex); } }
private void frmGAEBExport_Load(object sender, EventArgs e) { try { if (Utility.LVDetailsAccess == "7") { layoutControl1.Enabled = false; } string[] _D_formats = { "D81", "D84", "D86", "P81", "P84", "P86", "X81", "X84", "X86" }; string[] _P_formats = { "P81", "P84", "P86", "X81", "X84", "X86" }; if (_Raster > 9) { foreach (string p in _P_formats) { cmbFormatType.Properties.Items.Add(p); } cmbFormatType.SelectedIndex = cmbFormatType.Properties.Items.IndexOf("P86"); } else { foreach (string d in _D_formats) { cmbFormatType.Properties.Items.Add(d); } cmbFormatType.SelectedIndex = cmbFormatType.Properties.Items.IndexOf("D86"); } txtFilePath.Text = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); if (ObjBGAEB == null) { ObjBGAEB = new BGAEB(); } cmbLVSection.Enabled = true; DataTable dtLVSection = new DataTable(); dtLVSection = ObjBGAEB.GetLVSection(_ProjectID); if (rtnOldRaster) { DataView dvLVSection = dtLVSection.DefaultView; dvLVSection.RowFilter = "LVSectionName = 'HA'"; } cmbLVSection.Properties.DataSource = dtLVSection; cmbLVSection.Properties.DisplayMember = "LVSectionName"; cmbLVSection.Properties.ValueMember = "LVSectionID"; Utility.SetCheckedComboexitValue(cmbLVSection, "HA"); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnProjectImport_ItemClick(object sender, ItemClickEventArgs e) { try { string strFilePath = string.Empty; XtraOpenFileDialog dlg = new XtraOpenFileDialog(); dlg.Title = "Dateiauswahl für GAEB Import"; dlg.CheckFileExists = true; dlg.CheckPathExists = true; dlg.Filter = "GAEB Files(*.D81;*.D83;*.D86;*.P81;*.P83;*.P86;*.X81;*.X83;*.X86) | *.D81;*.D83;*.D86;*.P81;*.P83;*.P86;*.X81;*.X83;*.X86"; dlg.RestoreDirectory = true; if (dlg.ShowDialog() == DialogResult.OK) { strFilePath = dlg.FileName; } if (!string.IsNullOrEmpty(strFilePath)) { SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false); SplashScreenManager.Default.SetWaitFormDescription("Importieren..."); string strOutputFilepath = string.Empty; string strOTTOFilePath = Application.UserAppDataPath + "\\"; if (!Directory.Exists(strOTTOFilePath)) { Directory.CreateDirectory(strOTTOFilePath); } string strFileName = Path.GetFileNameWithoutExtension(strFilePath); strOutputFilepath = strOTTOFilePath + strFileName + ".tml"; Utility.ProcesssFile(strFilePath, strOutputFilepath); BGAEB ObjBGAEB = new BGAEB(); EGAEB ObjEGAEB = new EGAEB(); ObjEGAEB.UserID = Utility.UserID; string strRaster = Utility.GetRaster(strOutputFilepath); ObjEGAEB.dsLVData = Utility.CreateDatasetSchema(strOutputFilepath, string.Empty, strRaster, ObjEGAEB); ObjEGAEB.LvRaster = strRaster; ObjEGAEB = ObjBGAEB.ProjectImport(ObjEGAEB); SplashScreenManager.CloseForm(false); frmViewProject Obj = new frmViewProject(ObjEGAEB); Obj.ShowDialog(); UpdateStatus("Projektdatenimport mit Erfolg abgeschlossen"); } } catch (Exception ex) { SplashScreenManager.CloseForm(false); Utility.ShowError(ex); } }
private void btnExport_Click(object sender, EventArgs e) { try { this.Close(); SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false); SplashScreenManager.Default.SetWaitFormDescription("Exportieren..."); XmlDocument XMLDoc = null; if (cmbFormatType.Text != string.Empty) { if (ObjBGAEB == null) { ObjBGAEB = new BGAEB(); } if (ObjEGAEB == null) { ObjEGAEB = new EGAEB(); } ObjEGAEB.ProjectNumber = txtProjectName.Text; string strOTTOFilePath = ObjEGAEB.DirPath = Application.UserAppDataPath + "\\"; XMLDoc = ObjBGAEB.Export(_ProjectID, cmbLVSection.EditValue, cmbFormatType.Text, _NewRaster, ObjEGAEB); if (!Directory.Exists(strOTTOFilePath)) { Directory.CreateDirectory(strOTTOFilePath); } string strOutputFilePath = string.Empty; strOutputFilePath = OutputFilePath = txtFilePath.Text + "\\" + txtFileName.Text + "." + cmbFormatType.Text; string strInputFilePath = strOTTOFilePath + txtFileName.Text + ".tml"; XMLDoc.Save(strInputFilePath); Utility.ProcesssFile(strInputFilePath, strOutputFilePath); } else { throw new Exception("Bitte wählen Sie das gewünschte GAEB Exportformat"); } SplashScreenManager.CloseForm(false); } catch (Exception ex) { SplashScreenManager.CloseForm(false); Utility.ShowError(ex); } }
private void rgRasterNumbers_SelectedIndexChanged(object sender, EventArgs e) { try { if (rgRasterNumbers.SelectedIndex == 0) { AddRaster(1); } if (rgRasterNumbers.SelectedIndex == 1) { if (objBGAEB == null) { objBGAEB = new BGAEB(); } txtNewRaster.Text = _NewRaster = objBGAEB.GetOld_Raster(_ProjectID);; } } catch (Exception ex) { Utility.ShowError(ex); } }
private void frmAddRaster_Load(object sender, EventArgs e) { try { if (objBGAEB == null) { objBGAEB = new BGAEB(); } string strTemp = objBGAEB.GetOld_Raster(_ProjectID); if (!string.IsNullOrEmpty(strTemp)) { rgRasterNumbers.Properties.Items[0].Enabled = false; } else { rgRasterNumbers.Properties.Items[1].Enabled = false; } rgRasterNumbers.SelectedIndex = -1; } catch (Exception ex) { Utility.ShowError(ex); } }