private void ibuttonSave_Click(object sender, EventArgs e) { GetData(ref newData); savedData = new modelNationalAgency(); savedData = newData.DeepClone(); this.Hide(); }
private void ibuttonAdd_Click(object sender, EventArgs e) { var agency = new modelNationalAgency(); agency.CreateNewEmpty(); Program.GData.dataLOV.Insert(agency); gridData.LoadGrid(); }
public formEditNationalAgency(modelNationalAgency agency) { InitializeComponent(); originalData = new modelNationalAgency(); originalData = agency.DeepClone(); newData = new modelNationalAgency(); newData = agency.DeepClone(); savedData = null; ShowCountries(); ShowData(originalData); }
private void ibuttonClose_Click(object sender, EventArgs e) { GetData(ref newData); if (!Program.Compare <modelNationalAgency>(originalData, newData)) { if (!Program.ShowMessageBox("Do you want to scrap changes?", true, "YES", "NO")) { return; } } newData = null; this.Hide(); }
private void GetData(ref modelNationalAgency agency) { agency.NACode = textNACode.Text; agency.AgencyName = textAgencyName.Text; agency.Country = Program.GData.dataLOV.getCountries.First(c => c.CountryCode() == comboCountry.Text).ID; }
private void ShowData(modelNationalAgency agency) { textNACode.Text = agency.NACode; textAgencyName.Text = agency.AgencyName; comboCountry.Text = Program.GData.dataLOV.getCountries.First(c => c.ID == agency.Country).CountryCode(); }