Exemplo n.º 1
0
        private void LoadData()
        {
            if (TaskID < 0)
            {
                return;
            }

            var task = new SysTask(TaskID);

            task.Load();

            phData.BindObjectToControls(task, "tbx");
        }
Exemplo n.º 2
0
        private void LoadData()
        {
            if (TaskID < 0)
            {
                return;
            }

            var task = new SysTask(TaskID);

            task.Load();

            phData.BindObjectToControls(task, "tbx");

            tbxFinishTime.Text = task.FinishTime.ToString("yyyy-MM-dd");
            tbxCategoryID.Text = EnumTypeHelper.GetDescriptionFromEnum(typeof(TaskCategory), task.CategoryID);
            tbxCounter.Text    = task.Content.CleanHtmlTag().Replace("\r", "").Replace("\n", "").Replace("&nbsp;", "").Length.ToString();
        }
Exemplo n.º 3
0
        private bool Check()
        {
            var whereClause = string.Format(" {0}='{1}' AND {2}='{3}' AND {4}='{5}'",
                                            SysTask.SQLCOL_STUDENTID, CurrentUser.ID, SysTask.SQLCOL_COURSEID, tbxCourseID.SelectedValue,
                                            SysTask.SQLCOL_CATEGORYID, tbxCategoryID.SelectedValue);
            var count = DataAccess.Count(typeof(SysTask), whereClause);

            if (count > 0)
            {
                var exsitTask = new SysTask();
                exsitTask.Load(whereClause);
                if (TaskID <= 0 || TaskID != exsitTask.ID)
                {
                    RegisterJsAjax("-1", "alert('每个作业项目只能提交一次,无法重复提交');");
                    return(false);
                }
            }

            return(true);
        }