public static string UpdateC(string Id) { try { Model_F_User loginUser = HttpContext.Current.Session["FLoginUser"] as Model_F_User; Id = Id.Filter(); Model_HomeWork model = new Model_HomeWork(); BLL_HomeWork bll = new BLL_HomeWork(); model = bll.GetModel(Id); model.HomeWork_Status = 0; model.HomeWork_FinishTime = null; if (loginUser.UserId != model.HomeWork_AssignTeacher)//当前登录用户和布置改作业的老师不一致 { return(""); } else { if (bll.Update(model)) { return("1"); } else { return(""); } } } catch (Exception) { return(""); } }
public static string UpdateS(string Id) { try { Model_F_User loginUser = HttpContext.Current.Session["FLoginUser"] as Model_F_User; Id = Id.Filter(); Model_HomeWork model = new Model_HomeWork(); BLL_HomeWork bll = new BLL_HomeWork(); model = bll.GetModel(Id); model.HomeWork_Status = 1; model.HomeWork_FinishTime = DateTime.Now; if (loginUser.UserId != model.HomeWork_AssignTeacher)//当前登录用户和布置改作业的老师不一致 { return(""); } else { if (bll.Update(model)) { //#region 执行数据分析,记录日志 //Model_StatsLog modelLog = new Model_StatsLog(); //modelLog.StatsLogId = Guid.NewGuid().ToString(); //modelLog.DataId = model.HomeWork_Id; //modelLog.DataName = model.HomeWork_Name; //modelLog.DataType = "1"; //modelLog.LogStatus = "2"; //modelLog.CTime = DateTime.Now; //modelLog.CUser = loginUser.UserId; //new BLL_StatsLog().ExecuteStatsAddLog(modelLog); //#endregion return("1"); } else { return(""); } } } catch (Exception) { return(""); } }