Exemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        decimal learn   = Decimal.Parse(TextBox1.Text);
        decimal play    = Decimal.Parse(TextBox2.Text);
        decimal sleep   = Decimal.Parse(TextBox3.Text);
        decimal free    = Decimal.Parse(TextBox4.Text);
        decimal sumtime = learn + play + sleep + free;

        if (sumtime > 24)
        {
            LearnSite.Common.WordProcess.Alert("你所花费的时间已经超过24小时,请仔细填写!", this.Page);
        }
        else
        {
            LearnSite.Model.Research rmode = new LearnSite.Model.Research();
            rmode.Rsid   = cook.Sid;
            rmode.Ryear  = cook.Syear;
            rmode.Rgrade = cook.Sgrade;
            rmode.Rclass = cook.Sclass;
            rmode.Rterm  = cook.ThisTerm;
            rmode.Rlearn = learn;
            rmode.Rplay  = play;
            rmode.Rsleep = sleep;
            rmode.Rfree  = free;
            rmode.Rdate  = DateTime.Now;
            LearnSite.BLL.Research rbll = new LearnSite.BLL.Research();
            if (!rbll.Exist(cook.Sid))
            {
                rbll.Add(rmode);
            }
            researchform.Visible = false;
            System.Threading.Thread.Sleep(500);
            list();
        }
    }
Exemplo n.º 2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        decimal learn   = Decimal.Parse(TextBox1.Text);
        decimal play    = Decimal.Parse(TextBox2.Text);
        decimal sleep   = Decimal.Parse(TextBox3.Text);
        decimal free    = Decimal.Parse(TextBox4.Text);
        decimal sumtime = learn + play + sleep + free;

        if (sumtime > 24)
        {
            LearnSite.Common.WordProcess.Alert("你所花费的时间已经超过24小时,请仔细填写!", this.Page);
        }
        else
        {
            int Sid    = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString());
            int syear  = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString());
            int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString());
            int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString());
            int sterm  = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString());
            LearnSite.Model.Research rmode = new LearnSite.Model.Research();
            rmode.Rsid   = Sid;
            rmode.Ryear  = syear;
            rmode.Rgrade = sgrade;
            rmode.Rclass = sclass;
            rmode.Rterm  = sterm;
            rmode.Rlearn = learn;
            rmode.Rplay  = play;
            rmode.Rsleep = sleep;
            rmode.Rfree  = free;
            rmode.Rdate  = DateTime.Now;
            LearnSite.BLL.Research rbll = new LearnSite.BLL.Research();
            if (!rbll.Exist(Sid))
            {
                rbll.Add(rmode);
            }
            researchform.Visible = false;
            System.Threading.Thread.Sleep(500);
            list();
        }
    }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LearnSite.Model.Research model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.Research model)
 {
     return(dal.Add(model));
 }