Example #1
0
        private void ambulanceTable_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            String oldID      = "";
            String oldStation = "";
            int    count      = 0;//Counter for crew loop.

            foreach (DataGridViewRow row in ambulanceTable.SelectedRows)
            {
                oldID      += row.Cells[0].Value.ToString();
                oldStation += row.Cells[1].Value.ToString();
            }
            using (StaffMemberContext dj = new StaffMemberContext())
            {
                var      crewCheck = from r in dj.StaffMembers where r.AmbulanceID == oldID select r;
                String[] crewList  = new String[crewCheck.Count()];
                foreach (StaffMember crew in crewCheck)
                {
                    crewList[count] = crew.GivenNames + " " + crew.Surname;
                    count++;
                }
                AddAmbulanceForm editForm = new AddAmbulanceForm(oldID, oldStation, crewList);
                editForm.Visible = true;
                Visible          = false;
            }
        }
Example #2
0
        private void addbtn_Click(object sender, EventArgs e)
        {
            AddAmbulanceForm add = new AddAmbulanceForm();

            add.Visible = true;
            Visible     = false;
        }