Exemplo n.º 1
0
		private void menuPrintLabelsResultPatrol_Click(object sender, EventArgs e)
		{
			Trace.WriteLine("FMain: Entering menuPrintLabelsResultPatrol_Click()");

			FPrintSelection printSelection = new FPrintSelection();
			printSelection.chkPrintAll.Text = "";
			printSelection.chkPrintAll.Checked = false;
			printSelection.chkPrintAll.Visible = false;
			printSelection.lblSelection.Text = "Patrull";

			// Add rows to dropdown
			Structs.Patrol[] patrols =
				CommonCode.GetPatrols();

			foreach (Structs.Patrol patrol in patrols)
			{
				System.Data.DataRow row =
					printSelection.TablePrintSelection.NewRow();
				row["Id"] = patrol.PatrolId.ToString();
				row["Name"] = patrol.PatrolId.ToString() + " - " + patrol.StartDateTimeDisplay.ToShortTimeString();
				printSelection.TablePrintSelection.Rows.Add(row);
			}

			// make sure there is a call back
			printSelection.EnablePrint +=
				new FPrintSelection.EnablePrintHandler(menuPrintLabelsResultPatrol_Print);
			printSelection.EnableMain +=
				new FPrintSelection.EnableMainHandler(enableMain);
			printSelection.lblSelection.Visible = true;
			printSelection.chkPrintAll.Checked = false;
			printSelection.chkPrintAll.Visible = false;
			printSelection.numericUpDown1.Visible = true;
			printSelection.lblNumericUpDown1.Visible = true;
			printSelection.lblNumericUpDown1.Text = "Hoppa över etiketter";
			printSelection.Visible = true;
			printSelection.Focus();

			Trace.WriteLine("FMain.menuPrintPrelResultPatrol_Click ending");
		}
Exemplo n.º 2
0
		private void menuPrintPatrollistByShooter_Click(object sender, System.EventArgs e)
		{
			Trace.WriteLine("FMain: Entering menuPrintPatrollistByShooter_Click()");

			FPrintSelection printSelection = new FPrintSelection();
			printSelection.chkPrintAll.Text = "Skriv ut samtliga skyttar";

			// Add rows to dropdown
			Structs.Shooter[] shooters =
				CommonCode.GetShooters();

			foreach(Structs.Shooter shooter in shooters)
			{
				System.Data.DataRow row =
					printSelection.TablePrintSelection.NewRow();
				row["Id"] = shooter.ShooterId;
				row["Name"] = shooter.Givenname + ", " + shooter.Surname;
				printSelection.TablePrintSelection.Rows.Add(row);
			}

			// make sure there is a call back
			printSelection.EnablePrint += 
				new FPrintSelection.EnablePrintHandler(menuPrintPatrollistByShooter_Print);
			printSelection.EnableMain += 
				new FPrintSelection.EnableMainHandler(enableMain);
			printSelection.Visible = true;
			printSelection.Focus();
		}
Exemplo n.º 3
0
		private void menuPrintResultClub_Click(object sender, System.EventArgs e)
		{
			Trace.WriteLine("FMain: Entering menuPrintResultClub_Click()");

			FPrintSelection printSelection = new FPrintSelection();
			printSelection.chkPrintAll.Text = "Skriv ut samtliga patruller";
			printSelection.chkPrintAll.Checked = false;
			printSelection.lblSelection.Text = "Patrull";

			// Add rows to dropdown
			Structs.Club[] clubs = 
				CommonCode.GetClubs();

			foreach(Structs.Club club in clubs)
			{
				if (CommonCode.GetShooters(club).Length>0)
				{
					System.Data.DataRow row =
						printSelection.TablePrintSelection.NewRow();
					row["Id"] = club.ClubId;
					row["Name"] = club.Name;
					printSelection.TablePrintSelection.Rows.Add(row);
				}
			}

			// make sure there is a call back
			printSelection.EnablePrint += 
				new FPrintSelection.EnablePrintHandler(menuPrintResultClub_Print);
			printSelection.EnableMain += 
				new FPrintSelection.EnableMainHandler(enableMain);
			printSelection.lblSelection.Visible = false;
			printSelection.chkPrintAll.Checked = false;
			printSelection.chkPrintAll.Visible = false;
			printSelection.Visible = true;
			printSelection.Focus();

			Trace.WriteLine("FMain.menuPrintResultClub_Click ending");
		}
Exemplo n.º 4
0
		private void menuPrintPatrollistByPatrol_Click(object sender, System.EventArgs e)
		{
			Trace.WriteLine("FMain: Entering menuPrintPatrollistByPatrol_Click()");

			FPrintSelection printSelection = new FPrintSelection();
			printSelection.chkPrintAll.Checked = false;
			switch(CommonCode.GetCompetitions()[0].Type)
			{
				case Structs.CompetitionTypeEnum.Field:
					printSelection.chkPrintAll.Text = "Skriv ut samtliga patruller";
					printSelection.lblSelection.Text = "Patrull";
					break;
				case Structs.CompetitionTypeEnum.Precision:
					printSelection.chkPrintAll.Text = "Skriv ut samtliga lag";
					printSelection.lblSelection.Text = "Lag";
					break;
			}

			// Add rows to dropdown
			Structs.Patrol[] patrols = 
				CommonCode.GetPatrols();

			foreach(Structs.Patrol patrol in patrols)
			{
				System.Data.DataRow row =
					printSelection.TablePrintSelection.NewRow();
				row["Id"] = patrol.PatrolId;
				row["Name"] = patrol.PatrolId.ToString() + " - " + 
					patrol.StartDateTimeDisplay.ToShortTimeString() +
					" - " + patrol.PClass.ToString();
				printSelection.TablePrintSelection.Rows.Add(row);
			}

			// make sure there is a call back
			printSelection.EnablePrint += 
				new FPrintSelection.EnablePrintHandler(menuPrintPatrollistByPatrol_Print);
			printSelection.EnableMain += 
				new FPrintSelection.EnableMainHandler(enableMain);
			printSelection.Visible = true;
			printSelection.Focus();
		}