Example #1
0
        public void CreateNewReport(LogIncidentReportHandler c)
        {
            c.ChooseReporter(4);
            c.CreateNewIncidentReport( );

            Console.WriteLine("Select ID of the Weather when the incident happened.");
            Console.WriteLine("\t1) Fine");
            Console.WriteLine("\t2) Rain");
            Console.WriteLine("\t3) Cloudy");
            Console.WriteLine("\t4) Windy");
            Console.WriteLine();
            int weatherID = (int.Parse(Console.ReadLine()) - 1);
            c.ChooseWeather(weatherID);
            c.LogIncidentReport();
        }
Example #2
0
 public void ModifyReport(LogIncidentReportHandler c)
 {
     c.ChooseReporter(4);
     Console.WriteLine("Please enter the ID of the Incident Report you want to modify.");
     int reportID = (int.Parse(Console.ReadLine()) - 1); // the id of the report -1 for the index.. if 0 is entered ..throws an exception
     c.ChooseReport(reportID);
     c.CreateNewIncidentReport();
     Console.WriteLine("Select ID of the Weather when the incident happened.");
     Console.WriteLine("\t1) Fine");
     Console.WriteLine("\t2) Rain");
     Console.WriteLine("\t3) Cloudy");
     Console.WriteLine("\t4) Windy");
     Console.WriteLine();
     int weatherID = (int.Parse(Console.ReadLine()) - 1);
     c.ModifyWeather(weatherID);
     c.ModifyReport();
 }
Example #3
0
        static void Main( string [ ] args )
        {
            Program p = new Program( );
            LogIncidentReportHandler c = new LogIncidentReportHandler ( );
            Console.WriteLine("Select and enter the number to do operation.\n");
            Console.WriteLine("1) Create a new incident report.");
            Console.WriteLine("2) Select and Modify an Incident Report.\n\n");
            int i = int.Parse(Console.ReadLine());
            if (i == 1)
            {
            p.CreateNewReport(c);
            }
            if (i == 2)
            {
            p.ModifyReport(c);
            }
              //c.TestCreateByVersion(12);

              Console.ReadLine ( );
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        // if (Page.IsPostBack == true)
        //{
            Debug.WriteLine("load page post back");
            //if (Page.IsPostBack == false)
            //{
            //    if (Profile.DropZoneStaffUser == null)
            //    {

            //        //Controller c = new Controller();
            //        //c.LogInStaff(User.Identity.Name);
            //        //Profile.DropZoneStaffUser = c.DropZoneStaffUser;
            //        //if (Profile.DropZoneStaffUser.AccessLevel == 3)
            //        //{
            //        //    Profile.SelectedDropZone = c.SelectedDropZone;
            //        //}
            //        //else
            //        //{

            //        //}
            //        Debug.WriteLine("user identity: " + User.Identity.Name);
            //        Debug.WriteLine("----------------------");
            //        Debug.WriteLine(" about page loaded...");
            //        Debug.WriteLine("----------------------");
            //    }

            //}

            handler = new LogIncidentReportHandler();
            //c.Reporter = Profile.DZStaffUser;
            handler.ChooseReporter(1);
            handler.CreateNewIncidentReport();
            // Load the:
            // Drop Zone Name to the DropZoneNameLabel
            //DropZoneNameLabel.Text = Controller.Instance.SelectedDropZone.DropZoneName;
            DropZoneNameLabel.Text = handler.Reporter.DropZoneName;

            // Drop Zone Code to the DropZoneCodeLabel
            //DropZoneCodeLabel.Text = Controller.Instance.SelectedDropZone.DropZoneCode;
            //DropZoneCodeLabel.Text = irc.DropZone.DropZoneCode;

            // Username Name to the ReporterNameTextBox
            //ReporterNameTextBox.Text = Controller.Instance.DZStaffUser.DropZoneStaffFirstName + " " + Controller.Instance.DZStaffUser.DropZoneStaffLastName;
            ReporterNameTextBox.Text = handler.Report.DropZoneStaff.FirstName;

            // Username Title to the ReporterTitleTextBox
            //ReporterTitleTextBox.Text = Controller.Instance.DZStaffUser.DropZoneStaffTitle;
            //ReporterTitleTextBox.Text = handler.IR.DropZoneStaff.StaffNumber;

            // Username Licence Type to the ReporterLicenceTypeDropDownList by value instead of index
            // Username Licence Number to the ReporterLicenceNumberTextBox

            // Increment the Incident ID value and load it. Save into controller?
            // Get current DateTime.Now.ToShortDateString for the Report Date. Don't show it, just add it to the controller/database without
            // the user knowing.

            //SeverityDropDownList.DataSource = irc.SeverityDropDownList;
            //SeverityDropDownList.DataBind();
        //}
    }