public void Edit(int Index_Header_Result) { frmHeaderTemplate fHeader_Template = new frmHeaderTemplate(); tHeaderTemplate otHeaderResult = tHeaderTemplate.byINDEX(Index_Header_Result); CServers oServers = new CServers(); CHeaderData oHeaderData = _Read_DB(otHeaderResult.HeaderLine); CHeaderTemplate oHeaderTemplate = new CHeaderTemplate(ref fHeader_Template, ref oHeaderData); fHeader_Template.tspHeader_Result_cmbServers.Text = otHeaderResult.ServerLine; fHeader_Template.tspHeader_Result_bntServers.Click += oServers.tspHeader_Result_bntServers_Click; oServers.Update_CMB(fHeader_Template.tspHeader_Result_cmbServers); fHeader_Template.tspHeader_Result_cmbServers.Text = otHeaderResult.ServerLine; if (fHeader_Template.ShowDialog() == DialogResult.OK) { otHeaderResult.ServerLine = fHeader_Template.tspHeader_Result_cmbServers.Text; otHeaderResult.FileForExtension = oServers.getFile(fHeader_Template.tspHeader_Result_cmbServers.SelectedIndex); otHeaderResult.ServerPassword = oServers.getPassword(fHeader_Template.tspHeader_Result_cmbServers.SelectedIndex); otHeaderResult.HeaderLine = SaveToDB(oHeaderTemplate.HeaderData); otHeaderResult.SaveAndFlush(); Update_LV(fMain.lsvHeader_Result); } }
public void Add() { frmHeaderTemplate fHeader_Template = new frmHeaderTemplate(); tHeaderTemplate otHeaderResult = new tHeaderTemplate(); CServers oServers = new CServers(); CHeaderTemplate oHeaderTemplate = new CHeaderTemplate(ref fHeader_Template); oServers.Update_CMB(fHeader_Template.tspHeader_Result_cmbServers); fHeader_Template.tspHeader_Result_bntServers.Click += oServers.tspHeader_Result_bntServers_Click; if (fHeader_Template.ShowDialog() == DialogResult.OK) { otHeaderResult.ServerLine = fHeader_Template.tspHeader_Result_cmbServers.Text; otHeaderResult.FileForExtension = oServers.getFile(fHeader_Template.tspHeader_Result_cmbServers.SelectedIndex); otHeaderResult.ServerPassword = oServers.getPassword(fHeader_Template.tspHeader_Result_cmbServers.SelectedIndex); otHeaderResult.HeaderLine = SaveToDB(oHeaderTemplate.HeaderData); otHeaderResult.SaveAndFlush(); Update_LV(fMain.lsvHeader_Result); fMain.lsvHeader_Result.Items[fMain.lsvHeader_Result.Items.Count - 1].Selected = true; fMain.lsvHeader_Result.Items[fMain.lsvHeader_Result.Items.Count - 1].Focused = true; } fHeader_Template.tspHeader_Result_bntServers.Click += oServers.tspHeader_Result_bntServers_Click; }