Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     accessControl();
     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));
     Projects  = BLL.CupProjectModel.FindByInt(ProjectID, "ID");
     if (Projects.Count > 0)
     {
         Project = Projects[0];
     }
     else
     {
         Project = new Models.DB.CupProjectModel();
     }
     Declarant   = BLL.CupDeclarantInfo.SelectOneByProjectID(ProjectID);
     TeamMember  = BLL.CupTeamMemberInfo.SelectByProjectId(ProjectID);
     Recommender = BLL.RecommendInfo.SelectByProjectId(ProjectID);
     Student     = BLL.StudentInfoModel.SelectOneByUserId(Project.UserID.ToString());
     if (Project.Category == "自然科学类学术论文")
     {
         WorkInfoList = BLL.CupWorksInfo.FindByInt(ProjectID, "ProjectID");
         if (WorkInfoList.Count > 0)
         {
             WorkInfo = WorkInfoList[0];
         }
         else
         {
             WorkInfo = new Models.DB.CupWorksInfo();
         }
     }
     else if (Project.Category == "哲学社会科学类社会调查报告和学术论文")
     {
         SurveyInfoList = BLL.CupWorksSurvey.FindByInt(ProjectID, "ProjectID");
         if (SurveyInfoList.Count > 0)
         {
             SurveyInfo = SurveyInfoList[0];
         }
         else
         {
             SurveyInfo = new Models.DB.CupWorksSurvey();
         }
     }
     else if (Project.Category == "科技发明制作")
     {
         InventionInfoList = BLL.CupWorksInvention.FindByInt(ProjectID, "ProjectID");
         if (InventionInfoList.Count > 0)
         {
             InventionInfo = InventionInfoList[0];
         }
         else
         {
             InventionInfo = new Models.DB.CupWorksInvention();
         }
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Context.Request["ProjectID"] == null)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            ProjectID    = Request["ProjectID"];
            CupModellist = BLL.CupProjectModel.FindByInt(ProjectID, "ID");
            if (Context.Session["user"] == null)
            {
                Response.Redirect("~/Web/Login/Default.aspx");
            }
            Match = BLL.Match.SelectOne(Convert.ToInt32(ProjectID));
            String UserID = Context.Session["user"].ToString();

            Studentlist = BLL.StudentInfoModel.FindByInt(UserID, "UserId");
            if (CupModellist.Count <= 0 || Studentlist.Count <= 0)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            Match = BLL.Match.SelectOne(Convert.ToInt32(CupModellist[0].MatchID));
            if (Match == null)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            Declarant = BLL.CupDeclarantInfo.SelectOne(ProjectID);
            if (Declarant == null)
            {
                Declarant = new Models.DB.CupDeclarantInfo();
            }
        }
Beispiel #3
0
        public static Models.DB.CupDeclarantInfo SelectOneByProjectID(string ProjectID)
        {
            int projectId = 0;

            Models.DB.CupDeclarantInfo DecLarant = new Models.DB.CupDeclarantInfo();
            if (string.IsNullOrEmpty(ProjectID))
            {
                return(DecLarant);
            }
            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.Birthday      = Convert.ToDateTime(dt.Rows[0]["Birthday"]);
                DecLarant.SchoolSystme  = dt.Rows[0]["SchoolSystme"].ToString();
                DecLarant.PaperTitle    = dt.Rows[0]["PaperTitle"].ToString();
                DecLarant.Address       = dt.Rows[0]["Address"].ToString();
                DecLarant.PostalCode    = dt.Rows[0]["PostalCode"].ToString();
                DecLarant.Phone         = dt.Rows[0]["Phone"].ToString();
                DecLarant.ProjectID     = Convert.ToInt32(dt.Rows[0]["ProjectID"]);
                DecLarant.BackGround    = dt.Rows[0]["BackGround"].ToString();
                DecLarant.TopAddress    = dt.Rows[0]["TopAddress"].ToString();
                DecLarant.TopPostalCode = dt.Rows[0]["TopPostalCode"].ToString();
                DecLarant.TopPhone      = dt.Rows[0]["TopPhone"].ToString();
                DecLarant.Id            = Convert.ToInt32(dt.Rows[0]["Id"]);
                return(DecLarant);
            }
            return(null);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Context.Request["ProjectID"] == null)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            ProjectID    = Request["ProjectID"];
            CupModellist = BLL.CupProjectModel.FindByInt(ProjectID, "ID");
            if (CupModellist.Count <= 0)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            Match = BLL.Match.SelectOne(Convert.ToInt32(CupModellist[0].MatchID));
            if (Match == null)
            {
                Response.Redirect("../../Match/Default.aspx");
            }
            model = BLL.CupDeclarantInfo.SelectOneByProjectID(ProjectID);
            if (model != null)
            {
                Response.Redirect(String.Format("~/Web/CupProjectModel/CupInfoEdit/DeclarantInfo.aspx?ProjectID={0}", model.ProjectID));
            }


            if (Context.Session["user"] == null)
            {
                Response.Redirect("~/Web/Login/Default.aspx");
            }

            String UserID = Context.Session["user"].ToString();

            Studentlist = BLL.StudentInfoModel.FindByInt(UserID, "UserId");
        }
Beispiel #5
0
        /// <summary>
        /// 插入挑战杯杯申报人信息
        /// </summary>
        /// <param name="BirthDay"></param>
        /// <param name="SchoolSystme"></param>
        /// <param name="PaperTitle"></param>
        /// <param name="TopAddress"></param>
        /// <param name="TopPostalCode"></param>
        /// <param name="TopPhone"></param>
        /// <param name="Address"></param>
        /// <param name="PostalCode"></param>
        /// <param name="Phone"></param>
        /// <param name="ProjectModelID"></param>
        /// <returns></returns>
        public static int Create(String BirthDay, String SchoolSystme, String PaperTitle, String TopAddress, String BackGround,
                                 String TopPostalCode, String TopPhone, String Address, String PostalCode, String Phone, String ProjectID)
        {
            #region 检查输入的合法性

            int      projectid;
            DateTime birthday;
            try
            {
                birthday  = Convert.ToDateTime(BirthDay);
                projectid = Convert.ToInt32(ProjectID);
            }
            catch
            {
                return(0);
            }
            #endregion

            #region 把数据组装成一个对象
            Models.DB.CupDeclarantInfo model = new Models.DB.CupDeclarantInfo();
            model.Address       = Address;
            model.BackGround    = BackGround;
            model.Birthday      = birthday;
            model.PaperTitle    = PaperTitle;
            model.Phone         = Phone;
            model.PostalCode    = PostalCode;
            model.ProjectID     = projectid;
            model.SchoolSystme  = SchoolSystme;
            model.TopAddress    = TopAddress;
            model.TopPhone      = TopPhone;
            model.TopPostalCode = TopPostalCode;
            #endregion

            return(DAL.Create.CreateOne(model));
        }