示例#1
0
        private void ibuttonSave_Click(object sender, EventArgs e)
        {
            GetData(ref newData);

            savedData = new modelNationalAgency();
            savedData = newData.DeepClone();
            this.Hide();
        }
示例#2
0
        private void ibuttonAdd_Click(object sender, EventArgs e)
        {
            var agency = new modelNationalAgency();

            agency.CreateNewEmpty();

            Program.GData.dataLOV.Insert(agency);
            gridData.LoadGrid();
        }
示例#3
0
        public formEditNationalAgency(modelNationalAgency agency)
        {
            InitializeComponent();

            originalData = new modelNationalAgency();
            originalData = agency.DeepClone();
            newData      = new modelNationalAgency();
            newData      = agency.DeepClone();
            savedData    = null;

            ShowCountries();
            ShowData(originalData);
        }
示例#4
0
        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();
        }
示例#5
0
 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;
 }
示例#6
0
 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();
 }