Example #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmTrainPassengers form = new frmTrainPassengers(this, _userInfor, null, 0);

            form.MdiParent = this.MdiParent;
            form.Show();
        }
Example #2
0
        private void tàuKháchXNKToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new Train.frmTrainPassengers(null, _userInfo, null, 0);

            frm.MdiParent = this;
            frm.Show();
        }
Example #3
0
        private void grdTrain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (this.grdTrain.SelectedRows.Count > 0)
                {
                    int selectedIndex = grdTrain.SelectedRows[0].Index;

                    // gets the RowID from the first column in the grid
                    Int64 trainID = Int64.Parse(grdTrain[0, selectedIndex].Value.ToString());

                    tblTrain train = TrainFactory.FindTrainByID(trainID);
                    if (train == null)
                    {
                        MessageBox.Show("Tàu khách này không còn tồn tại trong Cơ Sở Dữ Liệu. Bạn hãy kiểm tra lại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }


                    frmTrainPassengers form = new frmTrainPassengers(this, _userInfor, train, 1);
                    form.MdiParent = this.MdiParent;
                    form.Show();
                }
                else
                {
                    MessageBox.Show("Bạn cần chọn một bản ghi để cập nhật", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                if (GlobalInfo.IsDebug)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }