private void initData() { if (String.IsNullOrEmpty(Request["ProjectID"]) || String.IsNullOrEmpty(Request["MID"])) { Response.Redirect("Default.aspx"); } ProjectID = Request["ProjectID"].ToString(); MatchID = Request["MID"].ToString(); Match = BLL.Match.SelectOne(Convert.ToInt32(MatchID)); Innovations = BLL.InnovationProjectModel.FindByInt(ProjectID, "Id"); if (Innovations.Count > 0) { Innovation = Innovations[0]; } else { Innovation = new Models.DB.InnovationProjectModel(); } Declarant = BLL.InnovationDeclarantInfo.SelectOne(ProjectID); TeamMembers = BLL.InnovationTeamMember.SelectByProjectId(ProjectID); Tutors = BLL.Tutors.SelectByProjectId(ProjectID); Works = BLL.InnovationWorksInfo.FindByInt(ProjectID, "ProjectID"); if (Works.Count > 0) { WorkInfo = Works[0]; } else { WorkInfo = new Models.DB.InnovationWorksInfo(); } Student = BLL.StudentInfoModel.SelectOneByUserId(Innovation.UserID.ToString()); }
private void initData() { if (string.IsNullOrEmpty(Request["match"])) { Response.Redirect("../Match/Default.aspx"); } MatchID = Request["match"]; if (!string.IsNullOrEmpty(Request["page"])) { current_page = Convert.ToInt32(Request["page"].ToString()); } int matchid = 0; try { matchid = Convert.ToInt32(MatchID); } catch { Response.Redirect("../Match/Default.aspx"); } Match = BLL.Match.SelectOne(matchid); page_count = (int)Math.Ceiling(BLL.InnovationProjectModel.CountByMatchId(MatchID) / (double)page_size); if (current_page > page_count) { current_page = page_count; } if (current_page <= 0) { current_page = 1; } Innovations = BLL.InnovationProjectModel.SelectOnePage(current_page, page_size, MatchID); for (int i = 0; i < Innovations.Count; i++) { TeamMemberCount.Add((int)BLL.InnovationTeamMember.CountByProjectID(Innovations[i].Id.ToString())); InovationDeclarants.Add(BLL.InnovationDeclarantInfo.SelectOne(Innovations[i].Id.ToString())); Students.Add(BLL.StudentInfoModel.SelectOneByUserId(Innovations[i].UserID.ToString())); Tutors.Add(BLL.Tutors.SelectByProjectId(Innovations[i].Id.ToString())); list = BLL.InnovationWorksInfo.FindByInt(Innovations[i].Id.ToString(), "ProjectID"); CheckRecord.Add(BLL.CheckRecord.FindOne(Innovations[i].Id.ToString(), Match.MatchModel.ToString())); if (list.Count > 0) { InnovationWork = list[0]; } else { InnovationWork = new Models.DB.InnovationWorksInfo(); } } }
public static List <Models.DB.InnovationWorksInfo> FindByInt(String Value, String ValueName) { #region 输入合法性检查 int valueInt; try { valueInt = Convert.ToInt32(Value); } catch { return(null); } #endregion List <Models.DB.InnovationWorksInfo> list = new List <Models.DB.InnovationWorksInfo>(); DataTable dt = DAL.Select.QueryOne(valueInt, "Tb_InnovationWorksInfo", ValueName); foreach (DataRow row in dt.Rows) { Models.DB.InnovationWorksInfo model = new Models.DB.InnovationWorksInfo(); model.BaseContent = row["BaseContent"].ToString(); model.Features = row["Features"].ToString(); model.Budget = row["Budget"].ToString(); model.Id = Convert.ToInt32(row["Id"]); model.Category = row["Category"].ToString(); model.Expection = row["Expection"].ToString(); model.ProjectID = Convert.ToInt32(row["ProjectID"]); model.Purpose = row["Purpose"].ToString(); model.KeyProblem = row["KeyProblem"].ToString(); model.References = row["References"].ToString(); model.PersonnelDivision = row["PersonnelDivision"].ToString(); model.SecondCategories = row["SecondCategories"].ToString(); model.PracticalsStep = row["PracticalsStep"].ToString();; model.ProjectBasic = row["ProjectBasic"].ToString(); model.ProjectPlan = row["ProjectPlan"].ToString(); model.SpecificPlan = row["SpecificPlan"].ToString(); list.Add(model); } return(list); }
public static int UpDate(String ID, String[,] data, String ProjectID) { #region 检查输入的合法性 int id; if (data == null) { return(0); } try { id = Convert.ToInt32(ID); } catch { return(0); } #endregion #region 把数据组装成对象 Models.DB.InnovationWorksInfo model = new Models.DB.InnovationWorksInfo(); model.Category = data[0, 0]; model.SecondCategories = data[0, 1]; model.Purpose = data[0, 2]; model.References = data[0, 3]; model.BaseContent = data[0, 4]; model.KeyProblem = data[0, 5]; model.ProjectBasic = data[0, 6]; model.SpecificPlan = data[0, 7]; model.PracticalsStep = data[0, 8]; model.PersonnelDivision = data[0, 9]; model.ProjectPlan = data[0, 10]; model.Features = data[0, 11]; model.Expection = data[0, 12]; model.Budget = data[0, 13]; model.ProjectID = Convert.ToInt32(ProjectID); model.Id = id; #endregion return(DAL.Update.ChangeSome(model, "Id")); }
private bool initData(string ProjectId) { List <Models.DB.InnovationProjectModel> Projects = BLL.InnovationProjectModel.FindByInt(ProjectId, "Id"); if (Projects.Count <= 0) { return(false); } Project = Projects[0]; Match = BLL.Match.SelectOne(Project.MatchID); List <Models.DB.InnovationWorksInfo> WorksInfos = BLL.InnovationWorksInfo.FindByInt(ProjectId, "ProjectId"); if (WorksInfos.Count > 0) { WorksInfo = WorksInfos[0]; } TeamMembers = BLL.InnovationTeamMember.SelectByProjectId(ProjectId); Declarant = BLL.InnovationDeclarantInfo.SelectOne(ProjectId); Tutors = BLL.Tutors.SelectByProjectId(ProjectId); Student = BLL.StudentInfoModel.SelectOneByUserId(Project.UserID + ""); return(true); }
public static int CreateMore(String[,] data, String ProjectID) { #region 检查输入的合法性 if (data == null) { return(0); } #endregion #region 把数据组装成对象 List <Models.DB.InnovationWorksInfo> list = new List <Models.DB.InnovationWorksInfo>(); for (int i = 0; i < data.GetLength(0); i++) { Models.DB.InnovationWorksInfo model = new Models.DB.InnovationWorksInfo(); model.Category = data[i, 0]; model.SecondCategories = data[i, 1]; model.Purpose = data[i, 2]; model.References = data[i, 3]; model.BaseContent = data[i, 4]; model.KeyProblem = data[i, 5]; model.ProjectBasic = data[i, 6]; model.SpecificPlan = data[i, 7]; model.PracticalsStep = data[i, 8]; model.PersonnelDivision = data[i, 9]; model.ProjectPlan = data[i, 10]; model.Features = data[i, 11]; model.Expection = data[i, 12]; model.Budget = data[i, 13]; model.ProjectID = Convert.ToInt32(ProjectID); list.Add(model); } #endregion return(DAL.Create.CreateList(list)); }
private void initData() { if (string.IsNullOrEmpty(Request["MatchID"])) { Response.Redirect("../Match/Default.aspx"); } MatchID = Request["MatchID"]; if (!string.IsNullOrEmpty(Request["page"])) { current_page = Convert.ToInt32(Request["page"].ToString()); } int matchid = 0; try { matchid = Convert.ToInt32(MatchID); } catch { Response.Redirect("../Match/Default.aspx"); } Match = BLL.Match.SelectOne(matchid); if (Match.MatchModel == 1) { Projects = BLL.CupProjectModel.FindByInt(MatchID, "MatchID"); for (int i = 0; i < Projects.Count; i++) { CheckRecrod = BLL.CheckRecord.FindOne(Projects[i].ID.ToString(), Match.MatchModel.ToString()); if (CheckRecrod == null || CheckRecrod.AfterStatus != "初审通过") { Projects.RemoveAt(i); i--; continue; } TeamMemberCount.Add((int)BLL.CupTeamMemberInfo.CountByProjectID(Projects[i].ID + "")); Declarants.Add(BLL.CupDeclarantInfo.SelectOne(Projects[i].ID + "")); Students.Add(BLL.StudentInfoModel.SelectOneByUserId(Projects[i].UserID + "")); Recommenders.Add(BLL.RecommendInfo.SelectByProjectId(Projects[i].ID + "")); } page_count = (int)Math.Ceiling(Projects.Count / (double)page_size); // 获取总页数 if (current_page > page_count) { current_page = page_count; } if (current_page <= 0) { current_page = 1; } } else if (Match.MatchModel == 2) { Innovations = BLL.InnovationProjectModel.FindByInt(MatchID, "MatchID"); for (int i = 0; i < Innovations.Count; i++) { CheckRecrod = BLL.CheckRecord.FindOne(Innovations[i].Id.ToString(), Match.MatchModel.ToString()); if (CheckRecrod == null || CheckRecrod.AfterStatus != "初审通过") { Innovations.RemoveAt(i); i--; continue; } TeamMemberCount.Add((int)BLL.InnovationTeamMember.CountByProjectID(Innovations[i].Id.ToString())); InovationDeclarants.Add(BLL.InnovationDeclarantInfo.SelectOne(Innovations[i].Id.ToString())); Students.Add(BLL.StudentInfoModel.SelectOneByUserId(Innovations[i].UserID.ToString())); Tutors.Add(BLL.Tutors.SelectByProjectId(Innovations[i].Id.ToString())); list = BLL.InnovationWorksInfo.FindByInt(Innovations[i].Id.ToString(), "ProjectID"); if (list.Count > 0) { InnovationWork = list[0]; } else { InnovationWork = new Models.DB.InnovationWorksInfo(); } } page_count = (int)Math.Ceiling(Innovations.Count / (double)page_size); if (current_page > page_count) { current_page = page_count; } if (current_page <= 0) { current_page = 1; } } }