public static List<Teme> Select(bool status) { List<Teme> themes = Connection.dm.fsp_Teme_SelectByStatus(status).ToList(); Teme empty = new Teme(); empty.Naziv = "Odaberite temu"; empty.TemaID = 0; themes.Insert(0, empty); return themes; }
public void FillTeme(int id) { List<Teme> teme = new List<Teme>(); if (id != 0) teme = QAService.getAllTemeByID(id); else teme = DATeme.Select(true); Teme empty = new Teme(); empty.Naziv = "Odaberite temu"; empty.TemaID = 0; teme.Insert(0, empty); ddTema.DataSource = teme; ddTema.DataTextField = "Naziv"; ddTema.DataValueField = "TemaID"; ddTema.DataBind(); }
protected void themeSubmit_Click(object sender, EventArgs e) { Teme theme = new Teme(); if (listAreas.SelectedValue != "0") theme.OblastID = Convert.ToInt32(listAreas.SelectedValue); else theme.OblastID = null; if (themeInput.Text != "") theme.Naziv = themeInput.Text.Trim(); else { labelThemeInput.Visible = true; activateThemesTab(); return; } theme.Status = true; theme.DatumKreiranja = DateTime.Now; theme.DatumIzmjene = DateTime.Now; DATeme.Save(theme); BindThemes(); activateThemesTab(); labelThemeInput.Visible = false; themeInput.Text = ""; }
public static void Save(Teme theme) { Connection.dm.Teme.Add(theme); Connection.dm.SaveChanges(); }
private void BindQuestion() { if (Request["id"] != null) { questionId = Convert.ToInt32(Request["id"]); question = QAService.getPitanjeByID(questionId); List<Tagovi> tags = DAPitanja.SelectTags(questionId); foreach (Tagovi tag in tags) tagsInput.Text += tag.Naziv + ", "; ddTema.SelectedValue = question.TemaID.ToString(); Teme tema = new Teme(); if(question.TemaID != null) tema = DATeme.SelectTemaByID((int)question.TemaID); if (tema.OblastID != null) ddOblast.SelectedValue = tema.OblastID.ToString(); txtNaslovPitanja.Text = question.Naslov; wysiwyg.Text = question.Tekst; } }