Esempio n. 1
0
        public bool insertMoney(UserMoneyBean money)
        {
            string sum = "select Project_ID,sum(Money_Use) from tbl_UseMoney group by Project_ID having Project_ID='" + money.PrjID + "'";

            ds = db.GetDataSet(sum);
            double usemoney = 0;
            double moneyt   = 0;

            if (ds.Tables[0].Rows.Count > 0)
            {
                usemoney = Double.Parse(ds.Tables[0].Rows[0][1].ToString());
            }

            string money_totality = "select Project_RatifyMoney from tbl_ProjectSubmit where Project_ID='" + money.PrjID + "'";

            ds = db.GetDataSet(money_totality);
            if (ds.Tables[0].Rows[0][0].ToString() != "")
            {
                //string s = ds.Tables[0].Rows[0][0].ToString();
                moneyt = Double.Parse(ds.Tables[0].Rows[0][0].ToString());
            }

            double usem = moneyt - usemoney;

            sqlString = "insert into tbl_UseMoney(Project_ID,Money_Totality,Money_Use,Money_surplus,Money_UseDetails,Money_CrUse,Money_Time) values('" + money.PrjID + "'," + moneyt + "," + usemoney + "," + usem + ",'" + money.MoneyDetails + "'," + money.MoneyCrUse + ",'" + money.MoneyTime + "')";
            if (db.ExecuteSQL(sqlString) != -1)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        public ProjectSubmitBean getProject(string projectID)
        {
            sqlString = "select * from tbl_ProjectSubmit where Project_ID='" + projectID + "'";
            ds        = db.GetDataSet(sqlString);

            ps.PrjID          = ds.Tables[0].Rows[0][0].ToString();
            ps.PrjName        = ds.Tables[0].Rows[0][1].ToString();
            ps.PrjPerson      = ds.Tables[0].Rows[0][2].ToString();
            ps.PrjInstitute   = ds.Tables[0].Rows[0][3].ToString();
            ps.PrjNature      = ds.Tables[0].Rows[0][4].ToString();
            ps.PrjStatus      = ds.Tables[0].Rows[0][5].ToString();
            ps.PrjLicenseNo   = ds.Tables[0].Rows[0][6].ToString();
            ps.PrjSource      = ds.Tables[0].Rows[0][7].ToString();
            ps.PrjStartTime   = ds.Tables[0].Rows[0][8].ToString();
            ps.PrjPlanTime    = ds.Tables[0].Rows[0][9].ToString();
            ps.PrjResultForm  = ds.Tables[0].Rows[0][10].ToString();
            ps.PrjSecretGrade = ds.Tables[0].Rows[0][11].ToString();
            ps.PrjPlanMoney   = isDouble(ds.Tables[0].Rows[0][12].ToString());
            ps.PrjRatifyMoney = isDouble(ds.Tables[0].Rows[0][13].ToString());
            ps.PrjClass       = ds.Tables[0].Rows[0][14].ToString();
            ps.PrjCourse      = ds.Tables[0].Rows[0][15].ToString();
            ps.PrjLevel       = ds.Tables[0].Rows[0][16].ToString();
            ps.PrjTeam        = ds.Tables[0].Rows[0][17].ToString();
            ps.PrjContent     = ds.Tables[0].Rows[0][18].ToString();
            ps.PrjHistory     = ds.Tables[0].Rows[0][19].ToString();
            ps.PrjInnovate    = ds.Tables[0].Rows[0][20].ToString();
            ps.PrjMgDpart     = ds.Tables[0].Rows[0][21].ToString();

            return(ps);
        }
Esempio n. 3
0
        //初始化试卷,从数据库中将试题取出
        protected void InitData()
        {
            //Response.Write(Session["PaperID"].ToString());
            //Response.End();

            IDataParameter[] Params1 = new IDataParameter[2];
            SqlDataBase      DB      = new SqlDataBase();
            int paperID = int.Parse(Session["PaperID"].ToString());

            Params1[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID);            //试卷编号
            Params1[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "单选题");            //题目类型
            DataSet ds1 = DB.GetDataSet("Proc_PaperDetail", Params1);

            GridView1.DataSource = ds1;
            GridView1.DataBind();

            ((Label)GridView1.HeaderRow.FindControl("Label27")).Text = ((Label)GridView1.Rows[0].FindControl("Label4")).Text;

            IDataParameter[] Params2 = new IDataParameter[2];
            Params2[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID);            //试卷编号
            Params2[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "多选题");            //题目类型
            DataSet ds2 = DB.GetDataSet("Proc_PaperDetail", Params2);

            GridView2.DataSource = ds2;
            GridView2.DataBind();
            ((Label)GridView2.HeaderRow.FindControl("Label28")).Text = ((Label)GridView2.Rows[0].FindControl("Label8")).Text;

            IDataParameter[] Params3 = new IDataParameter[2];

            Params3[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID);            //试卷编号
            Params3[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "判断题");            //题目类型
            DataSet ds3 = DB.GetDataSet("Proc_PaperDetail", Params3);

            GridView3.DataSource = ds3;
            GridView3.DataBind();
            ((Label)GridView3.HeaderRow.FindControl("Label29")).Text = ((Label)GridView3.Rows[0].FindControl("Label12")).Text;

            IDataParameter[] Params4 = new IDataParameter[2];

            Params4[0] = DB.MakeInParam("@PaperID", SqlDbType.Int, 4, paperID);            //试卷编号
            Params4[1] = DB.MakeInParam("@Type", SqlDbType.VarChar, 10, "填空题");            //题目类型
            DataSet ds4 = DB.GetDataSet("Proc_PaperDetail", Params4);

            GridView4.DataSource = ds4;
            GridView4.DataBind();
            ((Label)GridView4.HeaderRow.FindControl("Label30")).Text = ((Label)GridView4.Rows[0].FindControl("Label17")).Text;
        }
Esempio n. 4
0
 public bool isNull(string prjID)
 {
     sqlString = "select * from tbl_ProjectEnd where Project_ID='" + prjID + "'";
     ds        = db.GetDataSet(sqlString);
     if (ds.Tables[0].Rows.Count > 0)
     {
         flag = false;
     }
     return(flag);
 }
Esempio n. 5
0
 public NewsBean getNews(string ID)
 {
     sqlString        = "select * from tbl_NewsBulletin where News_ID='" + ID + "'";
     ds               = db.GetDataSet(sqlString);
     news.NewsID      = ds.Tables[0].Rows[0][0].ToString();
     news.NewsName    = ds.Tables[0].Rows[0][1].ToString();
     news.NewsTime    = ds.Tables[0].Rows[0][2].ToString();
     news.NewsAuthor  = ds.Tables[0].Rows[0][3].ToString();
     news.NewsContent = ds.Tables[0].Rows[0][4].ToString();
     return(news);
 }
Esempio n. 6
0
        public UserBean getUser(String userID)
        {
            sqlString = "select * from tbl_Users where User_ID='" + userID + "'";
            ds        = db.GetDataSet(sqlString);

            user.UserID             = ds.Tables[0].Rows[0][0].ToString();
            user.UserName           = ds.Tables[0].Rows[0][1].ToString();
            user.UserSex            = ds.Tables[0].Rows[0][4].ToString();
            user.UserBirth          = ds.Tables[0].Rows[0][5].ToString();
            user.UserIdcard         = ds.Tables[0].Rows[0][6].ToString();
            user.UserPolitics       = ds.Tables[0].Rows[0][7].ToString();
            user.UserInstitute      = ds.Tables[0].Rows[0][8].ToString();
            user.UserLastDegree     = ds.Tables[0].Rows[0][9].ToString();
            user.UserTechnicalTitle = ds.Tables[0].Rows[0][10].ToString();
            user.UserCours          = ds.Tables[0].Rows[0][11].ToString();
            user.UserSearch         = ds.Tables[0].Rows[0][12].ToString();
            user.UserTel            = ds.Tables[0].Rows[0][13].ToString();
            user.UserMail           = ds.Tables[0].Rows[0][14].ToString();
            user.UserVitae          = ds.Tables[0].Rows[0][15].ToString();
            return(user);
        }