Esempio n. 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();
         }
     }
 }
Esempio n. 2
0
        public static int UpData(String ID, String[,] data, String ProjectID)
        {
            #region 检查输入的合法性
            if (data == null)
            {
                return(0);
            }
            #endregion

            #region 把数据组装成对象
            Models.DB.CupWorksSurvey model = new Models.DB.CupWorksSurvey();
            model.Categories        = data[0, 0];
            model.Purpose           = data[0, 1];
            model.Features          = data[0, 2];
            model.ApplyValue        = data[0, 3];
            model.PaperDigest       = data[0, 4];
            model.ReceivedAwards    = data[0, 5];
            model.References        = data[0, 6];
            model.SurveyWay         = data[0, 7];
            model.SurveyUnits       = data[0, 8];
            model.SameResearchLevel = data[0, 9];
            model.ProjectID         = Convert.ToInt32(ProjectID);
            model.Id = Convert.ToInt32(ID);
            #endregion

            return(DAL.Update.ChangeSome(model, "Id"));
        }
Esempio n. 3
0
        public static int CreateMore(String[,] data, String ProjectID)
        {
            #region 检查输入的合法性
            if (data == null)
            {
                return(0);
            }

            #endregion

            #region 把数据组装成对象
            List <Models.DB.CupWorksSurvey> list = new List <Models.DB.CupWorksSurvey>();
            for (int i = 0; i < data.GetLength(0); i++)
            {
                Models.DB.CupWorksSurvey model = new Models.DB.CupWorksSurvey();
                model.Categories        = data[i, 0];
                model.Purpose           = data[i, 1];
                model.Features          = data[i, 2];
                model.ApplyValue        = data[i, 3];
                model.PaperDigest       = data[i, 4];
                model.ReceivedAwards    = data[i, 5];
                model.References        = data[i, 6];
                model.SurveyWay         = data[i, 7];
                model.SurveyUnits       = data[i, 8];
                model.SameResearchLevel = data[i, 9];
                model.ProjectID         = Convert.ToInt32(ProjectID);
                list.Add(model);
            }
            #endregion

            return(DAL.Create.CreateList(list));
        }
Esempio n. 4
0
        public static List <Models.DB.CupWorksSurvey> FindByInt(String Value, String ValueName)
        {
            #region 输入合法性检查
            int valueInt;
            try
            {
                valueInt = Convert.ToInt32(Value);
            }
            catch
            {
                return(null);
            }
            #endregion

            List <Models.DB.CupWorksSurvey> list = new List <Models.DB.CupWorksSurvey>();

            DataTable dt = DAL.Select.QueryOne(valueInt, "Tb_CupWorksSurvey", ValueName);

            foreach (DataRow row in dt.Rows)
            {
                Models.DB.CupWorksSurvey model = new Models.DB.CupWorksSurvey();
                model.ApplyValue = row["ApplyValue"].ToString();
                model.Features   = row["Features"].ToString();

                model.Id                = Convert.ToInt32(row["ID"]);
                model.Categories        = row["Categories"].ToString();
                model.PaperDigest       = row["PaperDigest"].ToString();
                model.ProjectID         = Convert.ToInt32(row["ProjectID"]);
                model.Purpose           = row["Purpose"].ToString();
                model.ReceivedAwards    = row["ReceivedAwards"].ToString();
                model.References        = row["References"].ToString();
                model.SameResearchLevel = row["SameResearchLevel"].ToString();
                model.SurveyUnits       = row["SurveyUnits"].ToString();
                model.SurveyWay         = row["SurveyWay"].ToString();

                list.Add(model);
            }


            return(list);
        }