Example #1
0
        private void addBtn_Click(object sender, EventArgs e)
        {
            string            trainID           = trainIdBox.Text;
            string            trainName         = trainNameBox.Text;
            AdminAddTrainRepo adminAddTrainRepo = new AdminAddTrainRepo();

            adminAddTrainRepo.addTrain(trainID, trainName);
            MessageBox.Show("Train Added !");
        }
Example #2
0
        public AdminAddTrain(string userid)
        {
            InitializeComponent();
            this.userid = userid;
            AdminAddTrainRepo adminAddTrainRepo = new AdminAddTrainRepo();
            int trainMax = adminAddTrainRepo.maxTrainId() + 1;

            trainIdBox.Text    = "metro" + trainMax.ToString().PadLeft(4, '0');
            trainIdBox.Enabled = false;
        }