public void ShowTeacherInfo() { var user_view_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); var user_model = new BLL.CCOM.User_information().GetModel(UserID); var teacher_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + UserID); this.lblNumber.InnerText = user_view_model.User_number; this.lblName.InnerText = user_view_model.User_realname; this.ddlGender.SelectedValue = (Boolean)user_view_model.User_gender ? "1" : "0"; this.lblAgency.InnerText = user_view_model.Agency_name; this.txtPhone.Value = user_model.User_phone; DataSet ds = new BLL.CCOM.Title().GetList(""); this.ddlTitle.DataSource = ds.Tables[0].DefaultView; this.ddlTitle.DataTextField = "Title_name"; this.ddlTitle.DataValueField = "Title_id"; this.ddlTitle.DataBind(); this.ddlTitle.Items.Add(new ListItem("未设置", "0")); if (teacher_model != null) { if (teacher_model.Title_id != null) { this.ddlTitle.SelectedValue = teacher_model.Title_id.ToString(); } else { this.ddlTitle.SelectedValue = "0"; } this.txtSubject.Value = teacher_model.Subject; this.txtEmail.Value = teacher_model.Tutor_email; this.txtFixedPhone.Value = teacher_model.Tutor_fixedphone; this.txtPlace.Value = teacher_model.Tutor_location; this.txtIntroduce.Value = teacher_model.Tutor_introduce; } }
public void BindId_Type() { BLL.CCOM.Title bll = new BLL.CCOM.Title(); DataSet ds = bll.GetAllList(); this.ddlIdType.DataSource = ds.Tables[0].DefaultView; //this.ddlIdType.DataTextField = "Ct_name"; //this.ddlIdType.DataValueField = "Ct_id"; this.ddlIdType.DataTextField = "Title_name"; this.ddlIdType.DataValueField = "Title_id"; this.ddlIdType.DataBind(); ListItem item = new ListItem("--教师须填--", "#"); this.ddlIdType.Items.Insert(0, item); }
public string GetTitle(string UserID) { BLL.CCOM.Tutor bll = new BLL.CCOM.Tutor(); string str = string.Empty; try { Model.CCOM.Tutor model = bll.GetModel(" User_id='" + UserID + "'"); str = new BLL.CCOM.Title().GetModel((int)model.Title_id).Title_name; } catch { str = "未设置"; } return(str); }
public void ShowInfo() { Model.CCOM.View_User user_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); long Group_id = GetGroupId(UserID); if (Group_id == 0) { this.print_div.InnerHtml = " <div class=\"content\" align=\"center\"><h3>您尚未被分配到任何软件验收组<h3><table class=\"table table-striped table-bordered dataTable\"></table></div>";; btnSubmit.Visible = false; return; } var group_model = new BLL.CCOM.Reply_group().GetModel(" Group_id=" + Group_id); var leader_model = new BLL.CCOM.View_User().GetModel(" User_id=" + group_model.User_id); PageTitle = user_model.User_realname + "的软件验收表"; this.txtRunStatus.Disabled = true; this.txtFeature.Disabled = true; this.txtScore.Disabled = true; this.lblName.InnerText = user_model.User_realname; this.lblNumber.InnerHtml = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID); if (relation_model != null) { this.lblTeacher.InnerText = new BLL.CCOM.User_information().GetModel(relation_model.Teacher_id).User_realname; this.lblTitle.InnerText = new BLL.CCOM.Topic().GetModel(relation_model.Topic_id).Topic_name; } else { return; } string leader_title = "--"; var leader_tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + leader_model.User_id); if (leader_tutor_model != null) { if (leader_tutor_model.Title_id != null) { leader_title = new BLL.CCOM.Title().GetModel((int)leader_tutor_model.Title_id).Title_name; } else { leader_title = "--"; } } reviewTr = "<tr><td style=\"text-align:center;\">组长</td><td style=\"text-align:center;\">" + leader_model.User_realname + "</td><td style=\"text-align:center;\">" + leader_title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + leader_model.Agency_name + "</td></tr>"; var rcs = new BLL.CCOM.Reply_commission().GetModelList(" Group_id=" + Group_id); foreach (var rc in rcs) { var u_model = new BLL.CCOM.View_User().GetModel(" User_id=" + rc.User_id); string title = "--"; var tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + rc.User_id); if (tutor_model != null) { if (tutor_model.Title_id != null) { title = new BLL.CCOM.Title().GetModel((int)tutor_model.Title_id).Title_name; } else { title = "--"; } } reviewTr += "</tr><td style=\"text-align:center;\">组员</td><td style=\"text-align:center;\">" + u_model.User_realname + "</td><td style=\"text-align:center;\">" + title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + u_model.Agency_name + "</td></tr>"; } var software_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (software_model != null) { if (software_model.Time != null) { this.lblTime.InnerText = software_model.Time.Value.ToString("yyyy年MM月dd日 HH:mm:ss"); } this.txtDataList.InnerText = software_model.Data_list; this.txtAnguage.InnerText = software_model.anguage; this.txtEnvironmental.InnerText = software_model.Environmental; this.txtLineCount.InnerText = software_model.Line_count; this.txtLineHand.InnerText = software_model.Line_hand; this.txtRunStatus.InnerText = software_model.Run_status; this.txtFeature.InnerText = software_model.Feature; this.txtScore.Value = software_model.Conclusion.ToString(); } }
public void ShowInfo() { Model.CCOM.View_User user_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); var group_model = new BLL.CCOM.Reply_group().GetModel(" Group_id=" + Group_id); var leader_model = new BLL.CCOM.View_User().GetModel(" User_id=" + group_model.User_id); if (GetAdminInfo_CCOM().User_id != leader_model.User_id) { this.txtOpinion.Disabled = true; this.ddlresult.Enabled = false; this.btnSubmit.Visible = false; } this.lblName.InnerText = user_model.User_realname; this.lblNumber.InnerHtml = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID); if (relation_model != null) { this.lblTeacher.InnerText = new BLL.CCOM.User_information().GetModel(relation_model.Teacher_id).User_realname; var topic_model = new BLL.CCOM.Topic().GetModel(relation_model.Topic_id); this.lblTitle.InnerText = topic_model.Topic_name; this.lblNature.InnerText = topic_model.Topic_nature; this.lblSource.InnerText = topic_model.Topic_source; } else { return; } string leader_title = "--"; var leader_tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + leader_model.User_id); if (leader_tutor_model != null) { if (leader_tutor_model.Title_id != null) { leader_title = new BLL.CCOM.Title().GetModel((int)leader_tutor_model.Title_id).Title_name; } else { leader_title = "--"; } } reviewTr = "<tr><td style=\"text-align:center;\">组长</td><td style=\"text-align:center;\">" + leader_model.User_realname + "</td><td style=\"text-align:center;\">" + leader_title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + leader_model.Agency_name + "</td></tr>"; var rcs = new BLL.CCOM.Reply_commission().GetModelList(" Group_id=" + Group_id); foreach (var rc in rcs) { var u_model = new BLL.CCOM.View_User().GetModel(" User_id=" + rc.User_id); string title = "--"; var tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + rc.User_id); if (tutor_model != null) { if (tutor_model.Title_id != null) { title = new BLL.CCOM.Title().GetModel((int)tutor_model.Title_id).Title_name; } else { title = "--"; } } reviewTr += "</tr><td style=\"text-align:center;\">组员</td><td style=\"text-align:center;\">" + u_model.User_realname + "</td><td style=\"text-align:center;\">" + title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + u_model.Agency_name + "</td></tr>"; } var proposal_model = new BLL.CCOM.Proposal().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (proposal_model != null) { this.txtOpinion.InnerText = proposal_model.Review; this.ddlresult.SelectedValue = proposal_model.Result.ToString(); } }
protected string ImportDataItem(DataSet ds, ref int success, ref int error)//基础数据 { string result = ""; BLL.CCOM.User_information stu_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information stu_model = new Model.CCOM.User_information(); BLL.CCOM.Topic topic_bll = new BLL.CCOM.Topic(); Model.CCOM.Topic topic_model = new Model.CCOM.Topic(); BLL.CCOM.Topic_relation rela_bll = new BLL.CCOM.Topic_relation(); Model.CCOM.Topic_relation rela_model = new Model.CCOM.Topic_relation(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string checkmsg = null; #region 添加学生信息========================== //学号 string number = ds.Tables[0].Rows[i]["学号"].ToString().Trim(); if (!ValidDFValue(number, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,学号" + checkmsg + "<br/>"; error++; continue; } else if (stu_bll.GetModel(" User_number='" + number + "'") != null) { stu_model = stu_bll.GetModel(" User_number='" + number + "'"); } else if (number != "") { stu_model.User_number = number; } //姓名 string name = ds.Tables[0].Rows[i]["姓名"].ToString().Trim(); if (!ValidDFValue(name, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,姓名" + checkmsg + "<br/>"; error++; continue; } else if (name != "") { stu_model.User_realname = name; } //性别 //string gender = ds.Tables[0].Rows[i]["性别"].ToString().Trim(); //if (!ValidDFValue(gender, true, "男|女", ref checkmsg)) //{ // result += "×第" + (i + 1).ToString() + "行数据更新失败,性别" + checkmsg + "<br/>"; // error++; // continue; //} //else if (gender == "男") //{ // stu_model.User_gender = false; //} //else if (gender == "女") //{ // stu_model.User_gender = true; //} //机构 stu_model.User_gender = false; string angency = ds.Tables[0].Rows[i]["行政班"].ToString().Trim(); if (!ValidDFValue(angency, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在班号" + checkmsg + "<br/>"; error++; continue; } BLL.CCOM.Agency agency_bll = new BLL.CCOM.Agency(); Model.CCOM.Agency agency_model = new Model.CCOM.Agency(); agency_model = agency_bll.GetModel(" Agency_name='" + angency + "'"); if (agency_model == null) { result += "×第" + (i + 1).ToString() + "行数据更新失败,所在班号不存在<br/>"; error++; continue; } stu_model.Agency_id = agency_model.Agency_id; stu_model.Role_id = 3; stu_model.User_password = DESEncrypt.MD5Encrypt(number); if (stu_bll.GetModel(" User_number='" + number + "'") == null) { stu_model.User_id = stu_bll.Add(stu_model); if (stu_model.User_id == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel("User_number='" + number + "'"); BLL.CCOM.Student student_bll = new BLL.CCOM.Student(); Model.CCOM.Student student_model = new Model.CCOM.Student(); student_model.User_id = user_model.User_id; student_model.Period_id = 4; student_bll.Add(student_model); } } else { if (!stu_bll.Update(stu_model)) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } } #endregion #region 更新导师信息========================== var tea_model = new Model.CCOM.Tutor(); //姓名 string tea_name = ds.Tables[0].Rows[i]["指导教师"].ToString().Trim(); if (!ValidDFValue(tea_name, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,指导教师" + checkmsg + "<br/>"; error++; continue; } else if (tea_name != "") { var tea_user_model = new BLL.CCOM.User_information().GetModel(" User_realname='" + tea_name + "'"); if (tea_user_model == null) { result += "×第" + (i + 1).ToString() + "行数据更新失败,指导教师" + tea_name + "不存在<br/>"; error++; continue; } tea_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + tea_user_model.User_id); string title_name = ds.Tables[0].Rows[i]["职称"].ToString().Trim(); if (!ValidDFValue(title_name, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,职称" + checkmsg + "<br/>"; error++; continue; } else if (title_name != "") { var title_model = new BLL.CCOM.Title().GetModel(" Title_name='" + title_name + "'"); if (title_model == null) { result += "×第" + (i + 1).ToString() + "行数据更新失败,职称" + title_name + "不存在<br/>"; error++; continue; } tea_model.Title_id = title_model.Title_id; if (!new BLL.CCOM.Tutor().Update(tea_model)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,更新导师信息失败<br/>"; error++; continue; } } } #endregion #region 导入选题信息========================== string topic_name = ds.Tables[0].Rows[i]["毕业设计题目"].ToString().Trim(); if (!ValidDFValue(topic_name, true, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,题目名称" + checkmsg + "<br/>"; error++; continue; } else if (topic_name != "") { topic_model.Topic_name = topic_name; } string Topic_nature = ds.Tables[0].Rows[i]["题目性质"].ToString().Trim(); if (!ValidDFValue(Topic_nature, false, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,题目性质" + checkmsg + "<br/>"; error++; continue; } else if (Topic_nature != "") { topic_model.Topic_nature = Topic_nature; } string Topic_source = ds.Tables[0].Rows[i]["题目来源"].ToString().Trim(); if (!ValidDFValue(Topic_source, false, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,题目来源" + checkmsg + "<br/>"; error++; continue; } else if (Topic_source != "") { topic_model.Topic_source = Topic_source; } string Topic_content = ds.Tables[0].Rows[i]["题目详情"].ToString().Trim(); if (!ValidDFValue(Topic_content, false, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,题目详情" + checkmsg + "<br/>"; error++; continue; } else if (Topic_content != "") { topic_model.Topic_content = Topic_content; } string Topic_task = ds.Tables[0].Rows[i]["任务书"].ToString().Trim(); if (!ValidDFValue(Topic_task, false, "", ref checkmsg)) { result += "×第" + (i + 1).ToString() + "行数据更新失败,任务书" + checkmsg + "<br/>"; error++; continue; } else if (Topic_task != "") { topic_model.Topic_task = Topic_task; } topic_model.Selected_state = true; topic_model.Check_state = 1; topic_model.Teacher_id = tea_model.User_id; topic_model.Company = "软件学院"; topic_model.Topic_id = topic_bll.Add(topic_model); if (topic_model.Topic_id == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } #endregion #region 题对应关系信息========================== if (rela_bll.GetModel(" Student_id=" + stu_model.User_id) != null && rela_bll.GetModel(" Student_id=" + stu_model.User_id).Accept_state != 2) { result += "×第" + (i + 1).ToString() + "行学生选题对应关系更新异常,该学生已经在系统有选题记录!<br/>"; error++; continue; } rela_model.Student_id = stu_model.User_id; rela_model.Teacher_id = tea_model.User_id; rela_model.Topic_id = topic_model.Topic_id; rela_model.Accept_state = 1; rela_model.Apply_time = DateTime.Now; rela_model.Topic_relation_id = rela_bll.Add(rela_model); if (rela_model.Topic_relation_id == 0) { result += "×第" + (i + 1).ToString() + "行数据更新异常<br/>"; error++; continue; } else { success++; } #endregion } return(result); }