Ejemplo n.º 1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            CourseCateInfo CourseClass = new CourseCateInfo();

            CourseClass.CateId       = RequestHelper.GetQueryString <int>("ID");
            CourseClass.ParentCateId = Convert.ToInt32(this.FatherID.Text);
            CourseClass.OrderIndex   = Convert.ToInt32(this.OrderID.Text);
            CourseClass.CateName     = this.ClassName.Text;
            CourseClass.CompanyId    = CompanyBLL.SystemCompanyId;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (CourseClass.CateId == -2147483648)
            {
                base.CheckAdminPower("AddCourseCate", PowerCheckType.Single);
                int id = CourseCateBLL.AddCourseCate(CourseClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("CourseCate"), id);
            }
            else
            {
                base.CheckAdminPower("UpdateCourseCate", PowerCheckType.Single);
                CourseCateBLL.UpdateCourseCate(CourseClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("CourseCate"), CourseClass.CateId);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int            queryString     = RequestHelper.GetQueryString <int>("ID");
                CourseCateInfo CourseCateModel = new CourseCateInfo();
                CourseCateModel.Condition  = systemCompanyId.ToString();
                this.CateId.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
                this.CateId.DataTextField  = "CateName";
                this.CateId.DataValueField = "CateId";
                this.CateId.DataBind();
                this.CateId.Items.Insert(0, new ListItem("请选择类别", "-1"));

                if (queryString != int.MinValue)
                {
                    base.CheckAdminPower("UpdateCourse", PowerCheckType.Single);
                    CourseInfo CourseModel = CourseBLL.ReadCourse(queryString);
                    //if (CompanyId.Items.Contains(CompanyId.Items.FindByValue(CourseModel.CompanyId.ToString()))) CompanyId.Items.FindByValue(CourseModel.CompanyId.ToString()).Selected = true;
                    if (this.CateId.Items.Contains(this.CateId.Items.FindByValue(CourseModel.CateId.ToString())))
                    {
                        this.CateId.Items.FindByValue(CourseModel.CateId.ToString()).Selected = true;
                    }
                    this.CourseName.Text = CourseModel.CourseName;
                    //this.CourseCode.Text = CourseModel.CourseCode;
                    this.OrderIndex.Text = CourseModel.OrderIndex.ToString();
                }
                else
                {
                    base.CheckAdminPower("AddCourse", PowerCheckType.Single);
                }
            }
            //Control control = FindControlById(this, "CompanyId1");
            //if (control != null) ScriptHelper.Alert("找到了");
        }
Ejemplo n.º 3
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("DeleteCourse", PowerCheckType.Single);
                    CourseBLL.DeleteCourse(id);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Course"), id);
                }
            }

            base.CheckAdminPower("ReadCourse", PowerCheckType.Single);
            if (!IsPostBack)
            {
                //在此处加载搜索框的类别信息
                CourseCateInfo CourseCateModel = new CourseCateInfo();
                CourseCateModel.Condition     = CompanyBLL.SystemCompanyId.ToString();
                SearchCategory.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
                SearchCategory.DataTextField  = "CateName";
                SearchCategory.DataValueField = "CateId";
                SearchCategory.DataBind();
                SearchCategory.Items.Insert(0, new ListItem("可以指定类别", "-1"));

                CourseInfo Model = new CourseInfo();
                Model.CourseName      = RequestHelper.GetQueryString <string>("CourseName");
                Model.CateIdCondition = RequestHelper.GetQueryString <string>("CateIdCondition");
                Model.Condition       = CompanyBLL.SystemCompanyId.ToString();
                Model.Field           = "CompanyId";
                base.BindControl(CourseBLL.ReadList(Model, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager);
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.CheckAdminPower("ReadCourseCate", PowerCheckType.Single);
            string action = RequestHelper.GetQueryString <string>("Action");
            int    id     = RequestHelper.GetQueryString <int>("ID");

            if ((!string.IsNullOrEmpty(action)) && id > 0)
            {
                if (action == "Down")
                {
                    base.CheckAdminPower("OrderCourseCate", PowerCheckType.Single);
                    CourseCateBLL.MoveDownCourseCate(id);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("MoveRecord"), ShopLanguage.ReadLanguage("CourseCate"), id);
                }
                else if (action == "Up")
                {
                    base.CheckAdminPower("OrderCourseCate", PowerCheckType.Single);
                    CourseCateBLL.MoveUpCourseCate(id);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("MoveRecord"), ShopLanguage.ReadLanguage("CourseCate"), id);
                }
                else if (action == "Delete")
                {
                    base.CheckAdminPower("DeleteCourseCate", PowerCheckType.Single);
                    CourseCateBLL.DeleteCourseCate(id);
                    AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("CourseCate"), id);
                }
            }

            CourseCateInfo CourseCateModel = new CourseCateInfo();

            CourseCateModel.Condition = CompanyBLL.SystemCompanyId.ToString();
            base.BindControl(CourseCateBLL.ReadCourseCateNamedList(CourseCateModel), this.RecordList);
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         base.CheckAdminPower("UpdateCourse", PowerCheckType.Single);
         CourseCateInfo CourseCateModel = new CourseCateInfo();
         CourseCateModel.Condition  = CompanyBLL.SystemCompanyId.ToString();
         this.CateId.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
         this.CateId.DataTextField  = "CateName";
         this.CateId.DataValueField = "CateId";
         this.CateId.DataBind();
         this.CateId.Items.Insert(0, new ListItem("请选择类别", "-1"));
     }
 }
Ejemplo n.º 6
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;
            }
        }
Ejemplo n.º 7
0
        protected void BindClassBrandAttributeClassStandardType()
        {
            //List<ProductBrandInfo> list = ProductBrandBLL.ReadProductBrandCacheList();
            //this.RelationBrandID.DataSource = list;
            //this.RelationBrandID.DataTextField = "Name";
            //this.RelationBrandID.DataValueField = "ID";
            //this.RelationBrandID.DataBind();
            //this.RelationBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

            List <ProductClassInfo> list2 = ProductClassBLL.ReadProductClassNamedList();

            foreach (ProductClassInfo info in list2)
            {
                this.RelationClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
            }
            this.RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            CourseCateInfo CourseCateModel = new CourseCateInfo();

            CourseCateModel.Condition = CompanyBLL.SystemCompanyId.ToString();
            List <CourseCateInfo> courseCateList = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);

            foreach (CourseCateInfo info in courseCateList)
            {
                this.AccessoryClassID.Items.Add(new ListItem(info.CateName, info.CateId.ToString()));
            }
            this.AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            this.AttributeClassID.DataSource     = AttributeClassBLL.ReadAttributeClassCacheList();
            this.AttributeClassID.DataTextField  = "Name";
            this.AttributeClassID.DataValueField = "ID";
            this.AttributeClassID.DataBind();
            this.AttributeClassID.Items.Insert(0, new ListItem("请选择", "0"));
            foreach (ArticleClassInfo info2 in ArticleClassBLL.ReadArticleClassChildList(3))
            {
                this.ArticleClassID.Items.Add(new ListItem(info2.ClassName, "|" + info2.ID + "|"));
            }
            this.ArticleClassID.Items.Insert(0, new ListItem(ArticleClassBLL.ReadArticleClassCache(3).ClassName, "|" + 3 + "|"));
            this.StandardType.DataSource     = EnumHelper.ReadEnumList <ProductStandardType>();
            this.StandardType.DataTextField  = "ChineseName";
            this.StandardType.DataValueField = "Value";
            this.StandardType.DataBind();
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CourseCateInfo CourseCateModel = new CourseCateInfo();
                CourseCateModel.Condition    = CompanyBLL.SystemCompanyId.ToString();
                this.FatherID.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
                this.FatherID.DataTextField  = "CateName";
                this.FatherID.DataValueField = "CateId";
                this.FatherID.DataBind();
                this.FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));

                int queryString = RequestHelper.GetQueryString <int>("ID");

                if (queryString != -2147483648)
                {
                    base.CheckAdminPower("ReadCourseCate", PowerCheckType.Single);
                    CourseCateInfo info = CourseCateBLL.ReadCourseCateCache(queryString);
                    this.FatherID.Text  = info.ParentCateId.ToString();
                    this.OrderID.Text   = info.OrderIndex.ToString();
                    this.ClassName.Text = info.CateName;
                }
            }
        }
Ejemplo n.º 9
0
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            if (SearchCategory.SelectedValue == "-1" && CourseName.Text == "")
            {
                ScriptHelper.Alert("请选择搜索条件!");
            }
            CourseInfo Model = new CourseInfo();

            Model.CourseName = CourseName.Text;
            if (SearchCategory.SelectedValue != "-1")
            {
                Model.CateIdCondition = SearchCategory.SelectedValue.ToString() + "," + CourseCateBLL.ReadSonCourseCateCache(int.Parse(SearchCategory.SelectedValue));
            }
            ResponseHelper.Redirect(("Course.aspx?Action=search&" + "CourseName=" + Model.CourseName + "&") + "CateIdCondition=" + Model.CateIdCondition);
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Control singleTest  = FindControlById(this, "singleTest");
            Control MultiTest   = FindControlById(this, "MultiTest");
            Control PanDuanTest = FindControlById(this, "PanDuanTest");

            if (!IsPostBack)
            {
                int queryString = RequestHelper.GetQueryString <int>("ID");
                int CourseId    = RequestHelper.GetQueryString <int>("CourseId");
                int cateid      = RequestHelper.GetQueryString <int>("CateId");

                CourseCateInfo CourseCateModel = new CourseCateInfo();
                CourseCateModel.Condition   = systemCompanyId.ToString();
                this._CateId.DataSource     = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);
                this._CateId.DataTextField  = "CateName";
                this._CateId.DataValueField = "CateId";
                this._CateId.DataBind();
                this._CateId.Items.Insert(0, new ListItem("请选择类别", "-1"));
                _CateId.SelectedValue = cateid.ToString();

                if (CourseId != int.MinValue)
                {
                    CourseInfo CourseModel = new CourseInfo();
                    CourseModel.CateId            = cateid;
                    this._CourseId.DataSource     = CourseBLL.ReadList(CourseModel);
                    this._CourseId.DataTextField  = "CourseName";
                    this._CourseId.DataValueField = "CourseId";
                    this._CourseId.DataBind();
                    _CourseId.SelectedValue = CourseId.ToString();
                }

                if (queryString != int.MinValue)
                {
                    base.CheckAdminPower("ReadQuestion", PowerCheckType.Single);
                    QuestionInfo QuestionModel = QuestionBLL.ReadQuestion(queryString);
                    int          CateId        = CourseBLL.ReadCourse(QuestionModel.CateId).CateId;
                    _CateId.SelectedValue = CateId.ToString();

                    CourseInfo CourseModel = new CourseInfo();
                    CourseModel.CateId            = CateId;
                    this._CourseId.DataSource     = CourseBLL.ReadList(CourseModel);
                    this._CourseId.DataTextField  = "CourseName";
                    this._CourseId.DataValueField = "CourseId";
                    this._CourseId.DataBind();
                    _CourseId.SelectedValue = QuestionModel.CateId.ToString();

                    this.Quetion.Text  = QuestionModel.Question;
                    this.TestType.Text = QuestionModel.Style;
                    if (QuestionModel.Style == "1")
                    {
                        this.SingleA.Text = QuestionModel.A;
                        this.SingleB.Text = QuestionModel.B;
                        this.SingleC.Text = QuestionModel.C;
                        this.SingleD.Text = QuestionModel.D;
                        switch (QuestionModel.Answer.ToUpper())
                        {
                        case "A":
                            this.SingleAnswerA.Checked = true;
                            break;

                        case "B":
                            this.SingleAnswerB.Checked = true;
                            break;

                        case "C":
                            this.SingleAnswerC.Checked = true;
                            break;

                        case "D":
                            this.SingleAnswerD.Checked = true;
                            break;
                        }
                        this.singleTest.Style.Add("display", "");
                        this.MultiTest.Style.Add("display", "none");
                        this.PanDuanTest.Style.Add("display", "none");
                    }
                    else if (QuestionModel.Style == "2")
                    {
                        this.MultiA.Text = QuestionModel.A;
                        this.MultiB.Text = QuestionModel.B;
                        this.MultiC.Text = QuestionModel.C;
                        this.MultiD.Text = QuestionModel.D;
                        for (int i = 0; i < QuestionModel.Answer.Length; i++)
                        {
                            switch (QuestionModel.Answer.ToUpper().Substring(i, 1))
                            {
                            case "A":
                                this.MultiAnswerA.Checked = true;
                                break;

                            case "B":
                                this.MultiAnswerB.Checked = true;
                                break;

                            case "C":
                                this.MultiAnswerC.Checked = true;
                                break;

                            case "D":
                                this.MultiAnswerD.Checked = true;
                                break;
                            }
                        }
                        this.singleTest.Style.Add("display", "none");
                        this.MultiTest.Style.Add("display", "");
                        this.PanDuanTest.Style.Add("display", "none");
                    }
                    else if (QuestionModel.Style == "3")
                    {
                        this.JudgeAnswer.Text = QuestionModel.Answer;
                        if (QuestionModel.Answer == "0")
                        {
                            JudgeRightAnswer.Text        = QuestionModel.A;
                            RightAnswer.Style["display"] = "";
                        }
                        this.singleTest.Style.Add("display", "none");
                        this.MultiTest.Style.Add("display", "none");
                        this.PanDuanTest.Style.Add("display", "");
                    }
                }
            }
        }