protected String formatRezim(Rezim val) { if (val == Rezim.STANDARDNI) { return("0"); } else { return("1"); } }
private void btnGetRezim_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; Rezim rez = new Rezim(); rez.rastr1 = rst1; rez.rastr2 = rst2; rez.startPoint = startCalcPoint; rez.CheckConvergenceMode(dgvRezim); Cursor.Current = Cursors.Default; }
/** * Defualts to Rezim.STANDARDNI * @param val * @return */ public Builder rezim(Rezim val) { _rezim = val; return(this); }
/// <summary> /// Replaces the placeholders. /// </summary> /// <param name="src">The source.</param> /// <param name="digest">The digest.</param> /// <param name="signature">The signature.</param> /// <returns></returns> /// <exception cref="ArgumentException">replacement processing got wrong</exception> private string ReplacePlaceholders(string src, string digest, string signature) { try { if (Certificate != null) { src = src.Replace("${certb64}", Convert.ToBase64String(Certificate.GetRawCertData())); } if (PrvniZaslani != null) { src = src.Replace("${prvni_zaslani}", FormatPrvniZaslani(PrvniZaslani.GetValueOrDefault())); } src = src.Replace("${dat_odesl}", FormatDate(DatOdesl)); src = src.Replace("${uuid_zpravy}", UuidZpravy.ToString()); if (Overeni != null) { src = src.Replace("${overeni}", FormatOvereni(Overeni.GetValueOrDefault())); } if (DicPopl != null) { src = src.Replace("${dic_popl}", DicPopl); } if (DicPoverujiciho != null) { src = src.Replace("${dic_poverujiciho}", DicPoverujiciho); } if (IdProvoz != null) { src = src.Replace("${id_provoz}", IdProvoz); } if (IdPokl != null) { src = src.Replace("${id_pokl}", IdPokl); } if (PoradCis != null) { src = src.Replace("${porad_cis}", PoradCis); } src = src.Replace("${dat_trzby}", FormatDate(DatTrzby)); if (CelkTrzba != null) { src = src.Replace("${celk_trzba}", FormatAmount(CelkTrzba.GetValueOrDefault())); } if (ZaklNepodlDph != null) { src = src.Replace("${zakl_nepodl_dph}", FormatAmount(ZaklNepodlDph.GetValueOrDefault())); } if (ZaklDan1 != null) { src = src.Replace("${zakl_dan1}", FormatAmount(ZaklDan1.GetValueOrDefault())); } if (Dan1 != null) { src = src.Replace("${dan1}", FormatAmount(Dan1.GetValueOrDefault())); } if (ZaklDan2 != null) { src = src.Replace("${zakl_dan2}", FormatAmount(ZaklDan2.GetValueOrDefault())); } if (Dan2 != null) { src = src.Replace("${dan2}", FormatAmount(Dan2.GetValueOrDefault())); } if (ZaklDan3 != null) { src = src.Replace("${zakl_dan3}", FormatAmount(ZaklDan3.GetValueOrDefault())); } if (Dan3 != null) { src = src.Replace("${dan3}", FormatAmount(Dan3.GetValueOrDefault())); } if (CestSluz != null) { src = src.Replace("${cest_sluz}", FormatAmount(CestSluz.GetValueOrDefault())); } if (PouzitZboz1 != null) { src = src.Replace("${pouzit_zboz1}", FormatAmount(PouzitZboz1.GetValueOrDefault())); } if (PouzitZboz2 != null) { src = src.Replace("${pouzit_zboz2}", FormatAmount(PouzitZboz2.GetValueOrDefault())); } if (PouzitZboz3 != null) { src = src.Replace("${pouzit_zboz3}", FormatAmount(PouzitZboz3.GetValueOrDefault())); } if (UrcenoCerpZuct != null) { src = src.Replace("${urceno_cerp_zuct}", FormatAmount(UrcenoCerpZuct.GetValueOrDefault())); } if (CerpZuct != null) { src = src.Replace("${cerp_zuct}", FormatAmount(CerpZuct.GetValueOrDefault())); } if (Rezim != null) { src = src.Replace("${rezim}", FormatRezim(Rezim.GetValueOrDefault())); } if (Bkp != null) { src = src.Replace("${bkp}", FormatBkp(Bkp)); } if (Pkp != null) { src = src.Replace("${pkp}", FormatPkp(Pkp)); } if (digest != null) { src = src.Replace("${digest}", digest); } if (signature != null) { src = src.Replace("${signature}", signature); } return(src); } catch (Exception e) { throw new ArgumentException("replacement processing got wrong", e); } }
public PredmetForm(Predmet predmet, Smer smer) { this.smer = smer; this.predmet = predmet; InitializeComponent(); comboBoxSmer.SelectedValueChanged += ComboBoxSmer_SelectedIndexChanged; checkedListBox1.ItemCheck += CheckedListBox1_ItemCheck; if (predmet != null) { popuniPolja(); textBoxID.Enabled = false; comboBoxSmer.Text = predmet.SmerPredmeta.ToString(); comboBoxSmer.Enabled = false; rezimRada = Rezim.Izmena; } else { if (smer == null) { rezimRada = Rezim.Dodavanje; foreach (Smer s in DataManger.getSmers()) { comboBoxSmer.Items.Add(s); } if (comboBoxSmer.Items.Count == 0) { comboBoxSmer.Enabled = false; } else { comboBoxSmer.SelectedIndex = 0; } } else { rezimRada = Rezim.DodavanjeNovomSmeru; comboBoxSmer.Items.Add(smer); comboBoxSmer.SelectedIndex = 0; comboBoxSmer.Enabled = false; } } popuniOpremaBox(); KeyPreview = true; KeyDown += (object sender, KeyEventArgs e) => { if (e.KeyCode == Keys.F1) { if (rezimRada == Rezim.Dodavanje || rezimRada == Rezim.DodavanjeNovomSmeru) { DataManger.goToHelp("dodavanjePredmet"); } else { DataManger.goToHelp("izmenaPredmet"); } } }; popuniSoftvere(); }