private void ibuttonSave_Click(object sender, EventArgs e) { GetData(ref newData); savedData = new modelCountry(); savedData = newData.DeepClone(); this.Hide(); }
private void ibuttonAdd_Click(object sender, EventArgs e) { var country = new modelCountry(); country.CreateNewEmpty(); Program.GData.dataLOV.Insert(country); gridData.LoadGrid(); }
private void GetData(ref modelCountry country) { float tmp; if (float.TryParse(textRate.Text, out tmp)) { country.Rate = tmp; } country.Code = textCode.Text; country.Country = textCountry.Text; }
public formEditCountry(modelCountry country) { InitializeComponent(); originalData = new modelCountry(); originalData = country.DeepClone(); newData = new modelCountry(); newData = country.DeepClone(); savedData = null; ShowData(originalData); }
private void ibuttonClose_Click(object sender, EventArgs e) { GetData(ref newData); if (!Program.Compare <modelCountry>(originalData, newData)) { if (!Program.ShowMessageBox("Do you want to scrap changes?", true, "YES", "NO")) { return; } } newData = null; this.Hide(); }
private void ShowData(modelCountry country) { textCode.Text = country.Code; textCountry.Text = country.Country; textRate.Text = country.Rate.ToString(); }