コード例 #1
0
ファイル: EditFAQ.aspx.cs プロジェクト: kaiss78/planningprep
 protected void BindFaqCategory()
 {
     App.Domain.FAQ.FaqCategoryManager manager = new App.Domain.FAQ.FaqCategoryManager();
     IList<FaqCategory> categories = manager.GetList();
     ddlFaqCategory.DataSource = categories;
     ddlFaqCategory.DataValueField = "FaqCatID";
     ddlFaqCategory.DataTextField = "Category";
     ddlFaqCategory.DataBind();
 }
コード例 #2
0
 protected void BindCategory()
 {
     if (_CategoryID > 0)
     {
         App.Domain.FAQ.FaqCategoryManager manager = new App.Domain.FAQ.FaqCategoryManager();
         FaqCategory category = manager.Get(_CategoryID);
         if (category == null)
         {
             pnlDetails.Visible = false;
             AppUtil.ShowMessageBox(divMessage, "Sorry! Requested FAQ Category was not found in the system.", true);
         }
         else
         {
             txtCategory.Text = category.Category;
         }
     }
 }
コード例 #3
0
    private void SaveCategory()
    {
        App.Domain.FAQ.FaqCategoryManager manager = new App.Domain.FAQ.FaqCategoryManager();
        FaqCategory category = null;
        if (_CategoryID == 0)
            category = new FaqCategory();
        else
            category = manager.Get(_CategoryID);

        if (category != null)
        {
            category.Category = txtCategory.Text.Trim();
            category.CatOrder = 5; //This is found hard coded in the old ASP Code
            category.EnteredBy = SessionCache.CurrentUser.Username;
            category.TimeStamp = DateTime.Now;

            manager.SaveOrUpdate(category);
        }
    }