Пример #1
0
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            base.CheckAdminPower("DeleteQuestion", PowerCheckType.Single);
            string intsForm = RequestHelper.GetIntsForm("SelectID");

            if (intsForm != string.Empty)
            {
                QuestionBLL.DeleteQuestion(intsForm);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Question"), intsForm);
                ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl);
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    id     = RequestHelper.GetQueryString <int>("ID");
            string Action = RequestHelper.GetQueryString <string>("Action");

            if (Action == "Delete")
            {
                if (id != int.MinValue)
                {
                    base.CheckAdminPower("DeleteQuestion", PowerCheckType.Single);
                    QuestionBLL.DeleteQuestion(id);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Question"), id);
                }
            }
            if (!IsPostBack)
            {
                base.CheckAdminPower("ReadQuestion", PowerCheckType.Single);

                updateQuestionPower = base.CompareAdminPower("UpdateQuestion", PowerCheckType.Single);
                deleteQuestionPower = base.CompareAdminPower("DeleteQuestion", PowerCheckType.Single);
                //在此处加载搜索框的信息
                //题型下拉框
                SearchQuestionStyle.DataSource     = EnumHelper.ReadEnumList <QuestionType>();
                SearchQuestionStyle.DataValueField = "Value";
                SearchQuestionStyle.DataTextField  = "ChineseName";
                SearchQuestionStyle.DataBind();
                SearchQuestionStyle.Items.Insert(0, new ListItem("选择题型", string.Empty));

                CourseCateInfo CourseCateModel = new CourseCateInfo();
                CourseCateModel.Condition     = systemCompanyId.ToString();
                SearchCategory.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
                SearchCategory.DataTextField  = "CateName";
                SearchCategory.DataValueField = "CateId";
                SearchCategory.DataBind();
                SearchCategory.Items.Insert(0, new ListItem("可以指定类别", int.MinValue.ToString()));

                QuestionInfo Model = new QuestionInfo();
                Model.Style       = RequestHelper.GetQueryString <string>("Style");
                Model.Question    = RequestHelper.GetQueryString <string>("QuestionName");
                Model.IdCondition = RequestHelper.GetQueryString <string>("IdCondition");
                Model.Field       = "CompanyId";
                Model.Condition   = systemCompanyId.ToString();
                base.BindControl(QuestionBLL.ReadList(Model, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager);//

                SearchQuestionName.Text           = Model.Question;
                SearchQuestionStyle.SelectedValue = Model.Style;
            }
        }