public void ShowInfo(int week_id) { Model.CCOM.Teach_week week_model = new BLL.CCOM.Teach_week().GetModel(week_id); this.txtStarttime.Value = week_model.Start_time.ToString("yyyy-MM-dd"); this.txtEndtime.Value = week_model.End_time.ToString("yyyy-MM-dd"); this.rblState.SelectedValue = week_model.State ? "1" : "0"; }
protected string DeleteWeek() { JsonData data = new JsonData(); string id = MyRequest.GetString("ID"); string msg = ""; try { BLL.CCOM.Teach_week bll = new BLL.CCOM.Teach_week(); bll.Delete(Int32.Parse(id)); } catch { msg = "删除发生异常!"; } if (msg == "") { data["msg"] = "删除成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
public void Bind_Data() { BLL.CCOM.Teach_week week_bll = new BLL.CCOM.Teach_week(); List <university.Model.CCOM.Teach_week> week_models = week_bll.GetModelList(""); string ht = ""; foreach (university.Model.CCOM.Teach_week week_model in week_models) { if (week_model != null) { ht += "<li id=\"section-1\" class=\"mainTab\">"; ht += "<hr style=\"height:10px;border:none;border-top:10px groove skyblue;\" />"; ht += "<div class=\"content\">"; ht += "<div class=\"span4\">"; ht += "<h3 class=\"sectionname\"><span>" + GetDateString(week_model.Start_time) + " - " + GetDateString(week_model.End_time) + "</span></h3><hr /></div>"; ht += "<div class=\"span6\" style=\"padding:22px 0;\">"; ht += "<a href=\"WeeklyAdd.aspx?weeklyId=" + week_model.TeachWeek_id + "&action=" + MyEnums.ActionEnum.Edit.ToString() + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %><i class=\"icon-pencil\"></i>修改</a> "; ht += "<a onclick=\"javascript:DeleteWeekly(" + week_model.TeachWeek_id + ")\"><i class=\"icon-remove\"></i>删除</a></div>"; ht += "<ul class=\"span12\">"; BLL.CCOM.Homework work_bll = new BLL.CCOM.Homework(); List <university.Model.CCOM.Homework> work_models = work_bll.GetModelList(" Week_id=" + week_model.TeachWeek_id); foreach (university.Model.CCOM.Homework work_model in work_models) { ht += "<li class=\"fileTab\"><div><div class=\"mod-indent-outer\"><div class=\"mod-indent\"></div><div><div class=\"activityinstance\">"; ht += "<a><img src=\"/images/sendfile.png\"/> 提交" + (new BLL.CCOM.Datum_type().GetModel(work_model.DatumType_id).DatumType_name) + "</a>"; ht += "</div></div></div></div></li>"; } ht += "</ul></div></li>"; } } this.week_list.InnerHtml = ht; }
//保存 protected void btn_Submit_Click(object sender, EventArgs e) { var student_models = new BLL.CCOM.User_information().GetModelList(" Role_id=3"); foreach (var student_model in student_models) { if (!new BLL.CCOM.User_information().Delete(student_model.User_id)) { JscriptMsg("删除学生:" + student_model.User_realname + "时,发生异常!", "", "Error"); return; } } var topic_models = new BLL.CCOM.Topic().GetModelList(""); foreach (var topic_model in topic_models) { if (!new BLL.CCOM.Topic().Delete(topic_model.Topic_id)) { JscriptMsg("删除选题:" + topic_model.Topic_name + "时,发生异常!", "", "Error"); return; } } var teachweek_models = new BLL.CCOM.Teach_week().GetModelList(""); foreach (var teachweek_model in teachweek_models) { if (!new BLL.CCOM.Teach_week().Delete(teachweek_model.TeachWeek_id)) { JscriptMsg("删除异常!", "", "Error"); return; } } var reply_models = new BLL.CCOM.Reply_group().GetModelList(""); foreach (var reply_model in reply_models) { if (!new BLL.CCOM.Reply_group().Delete(reply_model.Group_id)) { JscriptMsg("删除答辩组:" + reply_model.Group_name + "时,发生异常!", "", "Error"); return; } } var user_models = new BLL.CCOM.User_information().GetModelList(" Role_id!=1"); foreach (var student_model in user_models) { if (!new BLL.CCOM.User_information().Delete(student_model.User_id)) { JscriptMsg("删除用户:" + student_model.User_realname + "时,发生异常!", "", "Error"); return; } } JscriptMsg("初始化成功!", "InitSystem.aspx?fun_id=" + DESEncrypt.Encrypt(this.fun_id), "Success"); }
public void Bind_Data() { BLL.CCOM.Teach_week week_bll = new BLL.CCOM.Teach_week(); List <university.Model.CCOM.Teach_week> week_models = week_bll.GetModelList(""); string ht = ""; foreach (university.Model.CCOM.Teach_week week_model in week_models) { if (week_model != null) { ht += "<li id=\"section-1\" class=\"mainTab\">"; ht += "<hr style=\"height:10px;border:none;border-top:10px groove skyblue;\" />"; ht += "<div class=\"content\">"; ht += "<div class=\"span4\">"; ht += "<h3 class=\"sectionname\"><span>" + GetDateString(week_model.Start_time) + " - " + GetDateString(week_model.End_time) + "</span></h3><hr /></div>"; ht += "<div class=\"span6\" style=\"padding:22px 0;\">"; ht += "</div><ul class=\"span12\">"; BLL.CCOM.Homework work_bll = new BLL.CCOM.Homework(); List <university.Model.CCOM.Homework> work_models = work_bll.GetModelList(" Week_id=" + week_model.TeachWeek_id); foreach (university.Model.CCOM.Homework work_model in work_models) { if (work_model.DatumType_id == 2)//如果类型是提交开题报告 { ht += "<li class=\"fileTab\"><div><div class=\"mod-indent-outer\"><div class=\"mod-indent\"></div><div><div class=\"activityinstance\">"; ht += "<a href=\"StudentSubmit.aspx?homeworkId=" + work_model.Homework_id + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %><img src=\"/images/sendfile.png\"/> 提交" + (new BLL.CCOM.Datum_type().GetModel(work_model.DatumType_id).DatumType_name) + "</a>"; ht += "</div></div></div></div></li>"; } else { ht += "<li class=\"fileTab\"><div><div class=\"mod-indent-outer\"><div class=\"mod-indent\"></div><div><div class=\"activityinstance\">"; ht += "<a href=\"StudentSubmit.aspx?homeworkId=" + work_model.Homework_id + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %><img src=\"/images/sendfile.png\"/> 提交" + (new BLL.CCOM.Datum_type().GetModel(work_model.DatumType_id).DatumType_name) + "</a>"; ht += "</div></div></div></div></li>"; } } ht += "</ul></div></li>"; } } Model.CCOM.Topic_relation model = new Model.CCOM.Topic_relation(); model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + GetAdminInfo_CCOM().User_id + "and Accept_state=1"); if (model == null) { ht = " <div class=\"content\" align=\"center\"><h3>您尚无选题<h3></div>"; } this.week_list.InnerHtml = ht; }
public void Bind_Data() { BLL.CCOM.Teach_week week_bll = new BLL.CCOM.Teach_week(); List <university.Model.CCOM.Teach_week> week_models = week_bll.GetModelList(""); string ht = ""; foreach (university.Model.CCOM.Teach_week week_model in week_models) { if (week_model != null) { ht += "<li id=\"section-1\" class=\"mainTab\">"; ht += "<hr style=\"height:10px;border:none;border-top:10px groove skyblue;\" />"; ht += "<div class=\"content\">"; ht += "<div class=\"span4\">"; ht += "<h3 class=\"sectionname\"><span>" + GetDateString(week_model.Start_time) + " - " + GetDateString(week_model.End_time) + "</span></h3><hr /></div>"; ht += "<div class=\"span6\" style=\"padding:22px 0;\">"; ht += "</div><ul class=\"span12\">"; BLL.CCOM.View_Weeklog weeklog_bll = new BLL.CCOM.View_Weeklog(); List <university.Model.CCOM.View_Weeklog> worklog_models = weeklog_bll.GetModelList(" TeachWeek_id=" + week_model.TeachWeek_id + " and Teacher_id=" + GetAdminInfo_CCOM().User_id); foreach (university.Model.CCOM.View_Weeklog weeklog_model in worklog_models) { ht += "<li class=\"fileTab\"><div><div class=\"mod-indent-outer\"><div class=\"mod-indent\"></div><div><div class=\"activityinstance\">"; ht += "<a href=\"TeacherCheck.aspx?CheckId=" + weeklog_model.Weeklog_id + "&Homework_id=" + weeklog_model.Homework_id + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %><img src=\"/images/sendfile.png\"/> 查看" + weeklog_model.User_realname + "提交的周志</a>"; ht += "</div></div></div></div></li>"; } BLL.CCOM.View_Datum datum_bll = new BLL.CCOM.View_Datum(); List <university.Model.CCOM.View_Datum> datum_models = datum_bll.GetModelList(" TeachWeek_id=" + week_model.TeachWeek_id + " and Tutor_id=" + GetAdminInfo_CCOM().User_id); foreach (university.Model.CCOM.View_Datum datum_model in datum_models) { ht += "<li class=\"fileTab\"><div><div class=\"mod-indent-outer\"><div class=\"mod-indent\"></div><div><div class=\"activityinstance\">"; ht += "<a href=\"TeacherCheck.aspx?CheckId=" + datum_model.Datum_id + "&Homework_id=" + datum_model.Homework_id + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %><img src=\"/images/sendfile.png\"/> 查看" + new BLL.CCOM.User_information().GetModel(datum_model.Student_id).User_realname + "提交的" + datum_model.DatumType_name + "</a>"; ht += "</div></div></div></div></li>"; } ht += "</ul></div></li>"; } } this.week_list.InnerHtml = ht; }
public void ShowInfo(int homeworkId) { Model.CCOM.Homework work_model = new BLL.CCOM.Homework().GetModel(homeworkId); this.type.InnerText = new BLL.CCOM.Datum_type().GetModel(work_model.DatumType_id).DatumType_name; Boolean isOpen = new BLL.CCOM.Teach_week().GetModel(work_model.Week_id).State; if (isOpen) { this.massage.InnerText = ""; this.txtUserUpload.Enabled = true; this.btnUpload.Enabled = true; this.btnSubmit.Text = "提 交"; this.btnSubmit.Enabled = true; } else { this.massage.InnerText = "已关闭"; this.txtUserUpload.Enabled = false; this.btnUpload.Enabled = false; this.btnSubmit.Text = "已关闭"; this.btnSubmit.Enabled = false; } if (work_model.DatumType_id == 1) { this.fileTR.Visible = false; this.logTRcontent.Visible = true; this.logTRproblem.Visible = true; this.logTRplan.Visible = true; this.logTRstarttime.Visible = true; this.logTRendtime.Visible = true; this.btnSubmit.Visible = true; Model.CCOM.Week_log log_model = new BLL.CCOM.Week_log().GetModel(" Homework_id=" + homeworkId); if (log_model == null) { this.state.InnerText = "未提交"; } else { this.state.InnerText = "已提交"; this.time.InnerText = log_model.Submit_time.ToString("yyyy年MM月dd日 ddd HH:mm"); this.advice.InnerText = log_model.Advice; this.txtStarttime.Value = log_model.Start_time.ToString("yyyy-MM-dd"); this.txtEndtime.Value = log_model.End_time.ToString("yyyy-MM-dd"); this.txtContent.InnerText = log_model.Work_condition; this.txtProblem.InnerText = log_model.Problem; this.txtPlan.InnerText = log_model.Work_plan; this.btnSubmit.Text = "重新提交"; } } else { this.fileTR.Visible = true; this.logTRcontent.Visible = false; this.logTRproblem.Visible = false; this.logTRplan.Visible = false; this.logTRstarttime.Visible = false; this.logTRendtime.Visible = false; this.btnSubmit.Visible = false; Model.CCOM.View_Datum model = new BLL.CCOM.View_Datum().GetModel(" Homework_id=" + homeworkId); if (model == null) { this.state.InnerText = "未提交"; } else { this.state.InnerText = "已提交"; this.time.InnerText = model.Submit_time.ToString("yyyy年MM月dd日 ddd HH:mm"); this.advice.InnerText = model.Tutor_advice; this.lbtnDownLoad.Text = model.File_name; this.btnSubmit.Text = "重新提交"; } } }
public void ShowInfo(int homeworkId) { Model.CCOM.Homework work_model = new BLL.CCOM.Homework().GetModel(homeworkId); this.type.InnerText = new BLL.CCOM.Datum_type().GetModel(work_model.DatumType_id).DatumType_name; Boolean isOpen = new BLL.CCOM.Teach_week().GetModel(work_model.Week_id).State; if (isOpen) { this.massage.InnerText = ""; this.txtUserUpload.Enabled = true; this.btnUpload.Enabled = true; this.btnSubmit.Text = "提 交"; this.btnSubmit.Enabled = true; } else { this.massage.InnerText = "已关闭"; this.txtUserUpload.Enabled = false; this.btnUpload.Enabled = false; this.btnSubmit.Text = "已关闭"; this.btnSubmit.Enabled = false; } if (work_model.DatumType_id == 1)//周志 { this.fileTR.Visible = false; this.logTRcontent.Visible = true; this.logTRproblem.Visible = true; this.logTRplan.Visible = true; this.logTRstarttime.Visible = true; this.logTRendtime.Visible = true; this.btnSubmit.Visible = true; Model.CCOM.Week_log log_model = new BLL.CCOM.Week_log().GetModel(" Homework_id=" + homeworkId); if (log_model == null) { this.state.InnerText = "未提交"; } else { this.state.InnerText = "已提交"; this.time.InnerText = log_model.Submit_time.ToString("yyyy年MM月dd日 ddd HH:mm"); this.advice.InnerText = log_model.Advice; this.txtStarttime.Value = log_model.Start_time.ToString("yyyy-MM-dd"); this.txtEndtime.Value = log_model.End_time.ToString("yyyy-MM-dd"); this.txtContent.InnerText = log_model.Work_condition; this.txtProblem.InnerText = log_model.Problem; this.txtPlan.InnerText = log_model.Work_plan; this.btnSubmit.Text = "重新提交"; } } else //开题报告 { this.fileTR.Visible = true; this.logTRcontent.Visible = false; this.logTRproblem.Visible = false; this.logTRplan.Visible = false; this.logTRstarttime.Visible = false; this.logTRendtime.Visible = false; this.btnSubmit.Visible = false; Model.CCOM.View_Datum model = new BLL.CCOM.View_Datum().GetModel(" Homework_id=" + homeworkId); var user_model = HttpContext.Current.Session[MyKeys.SESSION_ADMIN_INFO] as Model.CCOM.User_information;//获得userid //String User_id_String = user_model.User_id.ToString(); Model.CCOM.View_Datum model_1 = new BLL.CCOM.View_Datum().GetModel("User_id=" + user_model.User_id.ToString() + "and Homework_id=" + homeworkId); if (model_1 == null) { this.state.InnerText = "未提交"; } else { this.state.InnerText = "已提交"; this.time.InnerText = model.Submit_time.ToString("yyyy年MM月dd日 ddd HH:mm"); this.advice.InnerText = model.Tutor_advice; this.lbtnDownLoad.Text = model.File_name; this.btnSubmit.Text = "重新提交"; } } }
private string DoAction() { string result = ""; int week_id = datumId; BLL.CCOM.Teach_week week_bll = new BLL.CCOM.Teach_week(); Model.CCOM.Teach_week week_model; if (action != MyEnums.ActionEnum.Edit.ToString()) { week_model = new Model.CCOM.Teach_week(); } else { week_model = week_bll.GetModel(datumId); } string startTime = this.txtStarttime.Value; string endTime = this.txtEndtime.Value; string state = this.rblState.SelectedValue; if (startTime == "") { return("请选择开始时间"); } if (endTime == "") { return("请选择结束时间"); } DateTime StartDate = Convert.ToDateTime(startTime); week_model.Start_time = StartDate; DateTime EndDate = Convert.ToDateTime(endTime); week_model.End_time = EndDate; week_model.State = Convert.ToInt32(state) != 0; try { if (action == MyEnums.ActionEnum.Edit.ToString()) //修改 { week_bll.Update(week_model); } else { week_id = week_bll.Add(week_model); } } catch (Exception ex) { return(action == MyEnums.ActionEnum.Edit.ToString() ? "修改失败" : "添加失败" + ex.Message.ToString()); } if (week_id == 0) { return("添加类型数据失败"); } BLL.CCOM.Homework work_bll = new BLL.CCOM.Homework(); //work_bll.Delete(" Week_id='" + week_id + "'");//首先清空原有数据 var work_models = work_bll.GetModelList(" Week_id='" + week_id + "'"); string[] typeList = this.txtAddName.Text.Split('|'); foreach (Model.CCOM.Homework work_model in work_models) { string workID = work_model.DatumType_id.ToString(); int flag = 0; for (int i = 0; i < typeList.Length; i++) { if (typeList[i] == workID) { typeList[i] = ""; flag = 1; break; } } if (flag == 0) { work_bll.Delete(" Homework_id=" + work_model.Homework_id); } } foreach (string type in typeList) { if (type == "") { continue; } int type_id = Int32.Parse(type); Model.CCOM.Homework work_model = new Model.CCOM.Homework(); work_model.Week_id = week_id; work_model.DatumType_id = type_id; work_bll.Add(work_model); } return(result); }