コード例 #1
0
    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;
            }
        }
    }
コード例 #2
0
 private void BindGridData()
 {
     ParamKnowledgeFamRepository repo = new ParamKnowledgeFamRepository();
     gridKnowledgeFam.DataSource = repo.GetAllKnowledgeFams();
 }