예제 #1
0
 public ActionResult BuyWork(WorkParam baseParam)
 {
     if (baseParam.IsCan)
     {
         return(Redirect(string.Format("/jump/Work?doworkId={0}&contentId={1}", baseParam.DoWorkBase.DoWorkID, baseParam.WorkResource.ContentId)));
     }
     return(View(baseParam));
 }
예제 #2
0
 public ActionResult BuyWork(WorkParam baseParam)
 {
     if (null != baseParam.PackagePermission && baseParam.PackagePermission.ExpirationDate > DateTime.Now)
     {
         return(Redirect(string.Format("/jump/Work?doworkId={0}&contentId={1}", baseParam.DoWorkBase.DoWorkID, baseParam.WorkResource.ContentId)));
     }
     return(View(baseParam));
 }
예제 #3
0
 /// <summary>
 /// 做作业viwe显示(重载)
 /// </summary>
 public override ActionResult DoWork(WorkParam baseParam, long doWorkId, long contentId)
 {
     //此处通过状态判断,如果已经提交作业,则直接用结果视图(WorkResult.cshtml)对数据进行处理
     if (baseParam.workStatus == 2 || baseParam.workStatus == 3)
     {
         return(View("WorkResult", baseParam));
     }
     return(View("DoWork", baseParam));
 }
예제 #4
0
 /// <summary>
 /// 做作业viwe显示(重载)
 /// </summary>
 public override ActionResult DoWork(WorkParam baseParam, long doWorkId, long contentId)
 {
     //此处通过状态判断,如果已经提交作业,则直接用结果视图(WorkResult.cshtml)对数据进行处理
     if (baseParam.workStatus == 2 || baseParam.workStatus == 3)
     {
         return(View("WorkResult", baseParam));                                      //作业快传听说模块的电子报和电子书共用一个视图页面。baseParam.PackageType == 3 ? "WorkResult" : "EbookWorkResult"
     }
     return(View(baseParam.PackageType == 3 ? "DoWork" : "EbookDoWork", baseParam)); //这段代码不会执行,暂时不管
 }
예제 #5
0
 public ActionResult Correct(WorkParam baseParam, long doWorkId, long contentId)
 {
     if (baseParam.DoWorkBase.SubmitUserID == baseParam.User.UserID)
     {
         return(Redirect(string.Format("/jump/work?doworkId={0}&contentId={1}", doWorkId, contentId)));
     }
     else if (baseParam.DoWorkBase.PublishUserId != baseParam.User.UserID)
     {
         return(Redirect("/home/Error?message=当前登录用户无操作权限"));
     }
     return(View(baseParam));
 }
예제 #6
0
        public JsonResult CreateWork(WorkParam baseParam, long contentId, long doWorkId)
        {
            if (baseParam.workStatus == 2 || baseParam.workStatus == 3)
            {
                return(Json(new ReturnResult(1, "作业已经完成啦,刷新页面试一试哦!")));
            }
            if (baseParam.UnitWork != null)
            {
                return(Json(baseParam.UnitWork.DoId));
            }

            var unitWorks = new UnitWorksContract();

            unitWorks.ContentId      = contentId;
            unitWorks.RecordId       = baseParam.WorkResource.RecordId;
            unitWorks.WorkId         = baseParam.DoWorkBase.WorkID;
            unitWorks.DoWorkId       = baseParam.DoWorkBase.DoWorkID;
            unitWorks.SubmitUserId   = baseParam.DoWorkBase.SubmitUserID;
            unitWorks.SubmitUserName = baseParam.DoWorkBase.SubmitUserName;
            unitWorks.SubmitDate     = DateTime.Now;
            unitWorks.IsTimeOut      = unitWorks.SubmitDate > baseParam.DoWorkBase.EffectiveDate;

            return(Json(workService.CreateUnitWork(unitWorks)));
        }
예제 #7
0
 public Work() : base()
 {
     param = base.param as WorkParam;
 }
예제 #8
0
 public override ActionResult DoWork(WorkParam baseParam, long doWorkId, long contentId)
 {
     return(View(baseParam));
 }