コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ImpDao impDaoObj = new ImpDao();
            int    cloID     = Request.QueryString["cloID"] == null ? 0 : Int32.Parse(Request.QueryString["cloID"]);

            if (Page.IsPostBack == false)
            {
                int  ruleID     = Request.QueryString["id"] == null ? 0 : Int32.Parse(Request.QueryString["id"]);
                bool viewMode   = Request.QueryString["viewMode"] == null ? false : Boolean.Parse(Request.QueryString["viewMode"]);
                bool editMode   = Request.QueryString["editMode"] == null ? false : Boolean.Parse(Request.QueryString["editMode"]);
                bool deleteMode = Request.QueryString["deleteMode"] == null ? false : Boolean.Parse(Request.QueryString["deleteMode"]);

                if (ruleID != 0)
                {
                    if (deleteMode)
                    {
                        deleteRule(ruleID);
                        Response.Redirect("~/KMSPages/ImpRuleList.aspx");
                    }

                    ImpRule rule = impDaoObj.getRuleByID(ruleID);
                    cloID         = rule.cloData.cloId;
                    ruleStmt.Text = rule.ruleStatemet;

                    if (viewMode == true)
                    {
                        ruleStmt.Enabled  = false;
                        DataList1.Enabled = false;
                    }

                    Button1.Visible = !viewMode;
                    cancelBtn.Text  = viewMode ? "Close" : "Cancel";
                    Button1.Text    = editMode ? "Update" : "Submit";
                }

                ViewState["cloID"] = cloID;

                AppCLO myClo = impDaoObj.getCloByCloID(cloID);
                TextBox1.Text = myClo.programName;
                TextBox2.Text = myClo.courseName;
                TextBox3.Text = myClo.cloStatement;
            }

            List <ImpRuleQuestion> quesList = impDaoObj.getRuleQuestionList(Int32.Parse(ViewState["cloID"].ToString()));

            DataList1.DataSource = quesList;
            DataList1.DataBind();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ImpDao impDaoObj = new ImpDao();
            int    cloID     = Request.QueryString["cloID"] == null ? 0 : Int32.Parse(Request.QueryString["cloID"]);

            if (Page.IsPostBack == false)
            {
                AppCLO myClo = impDaoObj.getCloByCloID(cloID);
                TextBox1.Text        = myClo.programName;
                TextBox2.Text        = myClo.courseName;
                TextBox3.Text        = myClo.cloStatement;
                expertSugLbl.Visible = false;
            }

            List <ImpRuleQuestion> quesList = impDaoObj.getRuleQuestionList(cloID);

            DataList1.DataSource = quesList;
            DataList1.DataBind();
        }