private void createUI() { Text = "Sudijske funkcije - " + Sprave.toString(odbor.Sprava); List <SudijskaUloga> uloge = new List <SudijskaUloga>(SudijskeUloge.getSveUloge()); int x = 12; int y = 12; int tabIndex = 0; this.SuspendLayout(); foreach (SudijskaUloga u in uloge) { this.Controls.Add(createCheckBox( u, new Point(x, y), tabIndex, odbor.hasFunction(u))); y += 23; tabIndex++; } y += 12; btnOK.Location = new Point(btnOK.Location.X, y); btnOK.TabIndex = tabIndex; btnCancel.Location = new Point(btnCancel.Location.X, y); btnCancel.TabIndex = tabIndex + 1; this.ClientSize = new Size(ClientSize.Width, btnOK.Bottom + 23); this.ResumeLayout(false); this.PerformLayout(); }
private List <object[]> getSudijskiOdborReportItems(SudijskiOdborNaSpravi odbor) { List <object[]> result = new List <object[]>(); foreach (SudijaNaSpravi sudija in odbor.Raspored) { result.Add(new object[] { SudijskeUloge.toString(sudija.Uloga), sudija.PrezimeIme, sudija.KlubDrzava }); } return(result); }
CheckBox createCheckBox(SudijskaUloga uloga, Point location, int tabIndex, bool check) { CheckBox result = new CheckBox(); result.AutoSize = true; result.Location = location; result.TabIndex = tabIndex; result.Text = SudijskeUloge.toString(uloga); result.UseVisualStyleBackColor = true; result.Tag = uloga; result.Checked = check; result.CheckedChanged += new EventHandler(ckb_CheckedChanged); return(result); }
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { // This method formats only boolean columns. Additional formating can be // specified in the AddColumn method. DataGridView dgw = (DataGridView)sender; if (e.Value == null) { return; } if (e.Value.GetType() == typeof(bool)) { if ((bool)e.Value == true) { e.Value = "Da"; } else { e.Value = "Ne"; } e.FormattingApplied = true; } else if (e.Value.GetType() == typeof(SudijskaUloga)) { e.Value = SudijskeUloge.toString((SudijskaUloga)e.Value); e.FormattingApplied = true; } else if (e.Value.GetType() == typeof(KvalifikacioniStatus)) { e.Value = KvalifikacioniStatusi.toString((KvalifikacioniStatus)e.Value); e.FormattingApplied = true; } else if (e.Value.GetType() == typeof(TipTakmicenja)) { if ((TipTakmicenja)e.Value == TipTakmicenja.FinaleKupa) { e.Value = "Finale kupa"; } else if ((TipTakmicenja)e.Value == TipTakmicenja.ZbirViseKola) { e.Value = "Zbir vise kola"; } else { e.Value = String.Empty; } e.FormattingApplied = true; } }
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { // This method formats only boolean columns. Additional formating can be // specified in the AddColumn method. DataGridView dgw = (DataGridView)sender; if (e.Value == null) { return; } if (e.Value.GetType() == typeof(bool)) { if ((bool)e.Value == true) { e.Value = "Da"; } else { if (ShowBooleanFalse) { e.Value = "Ne"; } else { e.Value = ""; } } e.FormattingApplied = true; } else if (e.Value.GetType() == typeof(SudijskaUloga)) { e.Value = SudijskeUloge.toString((SudijskaUloga)e.Value); e.FormattingApplied = true; } else if (e.Value.GetType() == typeof(KvalifikacioniStatus)) { e.Value = KvalifikacioniStatusi.toString((KvalifikacioniStatus)e.Value); e.FormattingApplied = true; } }