protected void Page_Load(object sender, EventArgs e) { if (SessionManager.CurrentUser == null) { Common.RedirectToLoginPage(this); return; } else if (!IsPostBack) { FillLabelLanguage(); ParamKnowledgeFamRepository repoKnowFam = new ParamKnowledgeFamRepository(); ddlKnowledgeFam.DataTextField = "ConFamilleID"; ddlKnowledgeFam.DataValueField = "ConFamilleID"; ddlKnowledgeFam.DataSource = repoKnowFam.GetAllKnowledgeFams(); ddlKnowledgeFam.DataBind(); if (!string.IsNullOrEmpty(Request.QueryString["KnowledgeID"])) { int knowledgeID = int.Parse(Request.QueryString["KnowledgeID"]); ParamKnowledge knowledge = new ParamKnowledgeRepository().FindOne(new ParamKnowledge(knowledgeID)); ddlKnowledgeFam.SelectedValue = knowledge.KnowledgeFamID; txtCode.Text = knowledge.Code; txtDefinition.Text = knowledge.Definition; } } }
private void BindGridData() { ParamKnowledgeFamRepository repo = new ParamKnowledgeFamRepository(); gridKnowledgeFam.DataSource = repo.GetAllKnowledgeFams(); }