コード例 #1
0
 protected void BtnOk_Click(object sender, EventArgs e)
 {
     Business.homework books = new Business.homework();
     Repeater1.DataSource = books.Get(string.Format(" and hwtit like '%{0}%' ", textfield.Value, (string)Session["UserClass"]));
     Repeater1.DataBind();
     books = null;
 }
コード例 #2
0
        protected void BtnOk_Click(object sender, EventArgs e)
        {
            Business.homework     homework     = new Business.homework();
            Business.homeworkData homeworkdata = new Business.homeworkData();

            homeworkdata.hwtit     = hwtit.Text;
            homeworkdata.hwtime    = hwtime.Text;
            homeworkdata.hwer      = hwer.Text;
            homeworkdata.press     = press.Text;
            homeworkdata.userclass = DropDownList1.SelectedValue;

            if (Request.QueryString["id"] != null)
            {
                homeworkdata.Id = Request.QueryString["id"];
                homework.Modify(homeworkdata);
            }
            else
            {
                homework.Insert(homeworkdata);
            }

            Response.Redirect("homeworktb.aspx");

            homework     = null;
            homeworkdata = null;
        }
コード例 #3
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string Id = e.CommandName;

            Business.homework homework = new Business.homework();
            homework.Delete(Id);
            Repeater1.DataSource = homework.Get("");
            Repeater1.DataBind();
            homework = null;
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Business.homework homework = new Business.homework();
         Repeater1.DataSource = homework.Get("");
         Repeater1.DataBind();
         homework = null;
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Session["UserId"] != null)
         {
             Label1.Text = Request.QueryString["type"];
             Business.homework books = new Business.homework();
             Repeater1.DataSource = books.Get(string.Format(" and userclass ='{0}'", Request.QueryString["type"]));
             Repeater1.DataBind();
             books = null;
         }
         else
         {
             Response.Redirect("login.aspx");
         }
     }
 }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    Business.homework       homework     = new Business.homework();
                    Business.homeworkData[] homeworkdata = homework.Select(Request.QueryString["id"]);

                    hwtit.Text  = homeworkdata[0].hwtit;
                    hwtime.Text = homeworkdata[0].hwtime;
                    hwer.Text   = homeworkdata[0].hwer;
                    press.Text  = homeworkdata[0].press;
                    DropDownList1.SelectedValue = homeworkdata[0].userclass;

                    homework     = null;
                    homeworkdata = null;
                }
            }
        }