Beispiel #1
0
    protected void btnSubmit_Click1(object sender, EventArgs e)
    {
        UserInfo user = Session["user"] as UserInfo;

        Model.Calendar calendar = new Model.Calendar();
        calendar.UId.UID      = user.UID;
        calendar.CalTheme     = txtTitle.Text.Trim();
        calendar.CalContent   = txDes.Value;
        calendar.TransactTime = Convert.ToDateTime(txtTime.Value);
        calendar.RemaindTime  = Convert.ToDateTime(txtJackTime.Value.Trim() + " " + txtHour.Text.Trim() + ":" + txtSecond.Text.Trim());

        calendar.CalType = droType.SelectedValue;
        calendar.Repeat  = rdoRepeat.SelectedValue;

        int flag = CalendarManager.AddCalendar(calendar);

        if (flag > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');location.href='SelectCalender.aspx';</script>");
            //增加操作日志
            //UserInfo users = (UserInfo)Session["CurUser"];
            //string operateName = users.LoginID;
            //DateTime operateTime = Convert.ToDateTime(DateTime.Now.ToString());
            //string operateType = users.LoginID + "添加了日程管理";
            //LogManage.AddSystemLog(operateName, operateTime, operateType);
            Response.Redirect("SelectCalender.aspx");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>");
        }
    }