예제 #1
0
        /* MainForm - Management - Edit
         * This Action will accept your change information for someone
         */
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (AgencyGribView.Rows.Count > 0)
            {
                var chinhsua = AgencyGribView.SelectedRows[0].DataBoundItem as Agency;
                var pf       = new EditAgency(chinhsua, GetVietTravel);

                if (pf.ShowDialog() == DialogResult.OK)
                {
                    agencyBindingSource.ResetBindings(false);
                    HotAndFuture();
                    GetVietTravel.Hendrichs = true;
                }
            }
            else
            {
                MessageBox.Show("Sorry, There are nothing to edit");
            }
        }
예제 #2
0
        /* MainForm - Management - Add
         * This Action Use To If You Want Add Client into Your data
         */
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var pf = new EditAgency(GetVietTravel);

            if (pf.ShowDialog() == DialogResult.OK)
            {
                if (pf.agency != null)
                {
                    foreach (Portion p in pf.agency.Portions)
                    {
                        p.Agency_Name    = pf.agency.Name;
                        pf.agency.Amount = pf.agency.Portions.Count;
                    }
                    GetVietTravel.Add_Agency(pf.agency);
                    agencyBindingSource.ResetBindings(false);
                    HotAndFuture();
                    GetVietTravel.Hendrichs = true;
                    var lastIdx = AgencyGribView.Rows.Count - 1;
                    AgencyGribView.Rows[lastIdx].Selected          = true;
                    AgencyGribView.FirstDisplayedScrollingRowIndex = lastIdx;
                }
            }
        }