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()); }
public static int Update(String ID, String ProjectID, String Phone, String Experience) { #region 检查输入的合法性 int projectid, id; try { id = Convert.ToInt32(ID); projectid = Convert.ToInt32(ProjectID); } catch { return(0); } #endregion #region 把数据组装成一个类的对象 Models.DB.InnovationDeclarantInfo model = new Models.DB.InnovationDeclarantInfo(); model.Experience = Experience; model.Phone = Phone; model.ProjectID = projectid; model.Id = id; #endregion return(DAL.Update.ChangeSome(model, "Id")); }
/// <summary> /// 根据项目ID选择一条记录 /// </summary> /// <param name="ProjectID"></param> /// <returns></returns> public static Models.DB.InnovationDeclarantInfo SelectOne(String ProjectID) { int projectId = 0; Models.DB.InnovationDeclarantInfo DecLarant = new Models.DB.InnovationDeclarantInfo(); if (string.IsNullOrEmpty(ProjectID)) { return(null); } try { projectId = Convert.ToInt32(ProjectID); } catch { return(null); } DecLarant.ProjectID = projectId; System.Data.DataTable dt = DAL.Select.GetList(DecLarant, "ProjectID"); if (dt.Rows.Count > 0) { DecLarant.Phone = dt.Rows[0]["Phone"].ToString(); DecLarant.ProjectID = Convert.ToInt32(dt.Rows[0]["ProjectID"]); DecLarant.Id = Convert.ToInt32(dt.Rows[0]["Id"]); DecLarant.Experience = dt.Rows[0]["Experience"].ToString(); return(DecLarant); } return(null); }
private void initData() { if (Context.Request["ProjectID"] == null) { Response.Redirect("../../Match/Default.aspx"); } if (Context.Session["user"] == null) { Response.Redirect(ResolveUrl("~/Web/Login/Default.aspx")); } ProjectID = Context.Request["ProjectID"].ToString(); UserID = Context.Session["user"].ToString(); Student = BLL.StudentInfoModel.SelectOneByUserId(UserID); Projects = BLL.InnovationProjectModel.FindByInt(ProjectID, "Id"); Declarant = BLL.InnovationDeclarantInfo.SelectOne(ProjectID); if (Declarant == null) { Declarant = new Models.DB.InnovationDeclarantInfo(); } if (Projects.Count <= 0) { Response.Redirect("../../Match/Default.aspx"); } Match = BLL.Match.SelectOne(Convert.ToInt32(Projects[0].MatchID)); if (Match == null) { Response.Redirect("../../Match/Default.aspx"); } }
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 Create(String ProjectID, String Phone, String Experience) { #region 检查输入的合法性 int projectid; try { projectid = Convert.ToInt32(ProjectID); } catch { return(0); } #endregion #region 把数据组装成一个类的对象 Models.DB.InnovationDeclarantInfo model = new Models.DB.InnovationDeclarantInfo(); model.Experience = Experience; model.Phone = Phone; model.ProjectID = projectid; #endregion return(DAL.Create.CreateOne(model)); }