Exemple #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public university.Model.CCOM.Examination_AEE_score GetModel(int AEE_id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select AEE_id, AEE_score, AEE_sequence, AEE_ranking, Period_id, User_id  ");
            strSql.Append("  from Examination_AEE_score ");
            strSql.Append(" where AEE_id=@AEE_id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AEE_id", SqlDbType.Int, 4)
            };
            parameters[0].Value = AEE_id;


            university.Model.CCOM.Examination_AEE_score model = new university.Model.CCOM.Examination_AEE_score();
            DataSet ds = DBSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["AEE_id"].ToString() != "")
                {
                    model.AEE_id = int.Parse(ds.Tables[0].Rows[0]["AEE_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_score"].ToString() != "")
                {
                    model.AEE_score = decimal.Parse(ds.Tables[0].Rows[0]["AEE_score"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_sequence"].ToString() != "")
                {
                    model.AEE_sequence = decimal.Parse(ds.Tables[0].Rows[0]["AEE_sequence"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_ranking"].ToString() != "")
                {
                    model.AEE_ranking = int.Parse(ds.Tables[0].Rows[0]["AEE_ranking"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Period_id"].ToString() != "")
                {
                    model.Period_id = int.Parse(ds.Tables[0].Rows[0]["Period_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["User_id"].ToString() != "")
                {
                    model.User_id = long.Parse(ds.Tables[0].Rows[0]["User_id"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public university.Model.CCOM.Examination_AEE_score GetModel(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select AEE_id, AEE_score, AEE_sequence, AEE_ranking, Period_id, User_id  ");
            strSql.Append("  from Examination_AEE_score ");
            strSql.Append(" where " + strWhere);


            university.Model.CCOM.Examination_AEE_score model = new university.Model.CCOM.Examination_AEE_score();
            DataSet ds = DBSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["AEE_id"].ToString() != "")
                {
                    model.AEE_id = int.Parse(ds.Tables[0].Rows[0]["AEE_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_score"].ToString() != "")
                {
                    model.AEE_score = decimal.Parse(ds.Tables[0].Rows[0]["AEE_score"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_sequence"].ToString() != "")
                {
                    model.AEE_sequence = decimal.Parse(ds.Tables[0].Rows[0]["AEE_sequence"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AEE_ranking"].ToString() != "")
                {
                    model.AEE_ranking = int.Parse(ds.Tables[0].Rows[0]["AEE_ranking"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Period_id"].ToString() != "")
                {
                    model.Period_id = int.Parse(ds.Tables[0].Rows[0]["Period_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["User_id"].ToString() != "")
                {
                    model.User_id = long.Parse(ds.Tables[0].Rows[0]["User_id"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(university.Model.CCOM.Examination_AEE_score model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Examination_AEE_score set ");

            strSql.Append(" AEE_score = @AEE_score , ");
            strSql.Append(" AEE_sequence = @AEE_sequence , ");
            strSql.Append(" AEE_ranking = @AEE_ranking , ");
            strSql.Append(" Period_id = @Period_id , ");
            strSql.Append(" User_id = @User_id  ");
            strSql.Append(" where AEE_id=@AEE_id ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@AEE_id",       SqlDbType.Int,    4),
                new SqlParameter("@AEE_score",    SqlDbType.Float,  8),
                new SqlParameter("@AEE_sequence", SqlDbType.Float,  8),
                new SqlParameter("@AEE_ranking",  SqlDbType.Int,    4),
                new SqlParameter("@Period_id",    SqlDbType.Int,    4),
                new SqlParameter("@User_id",      SqlDbType.BigInt, 8)
            };

            parameters[0].Value = model.AEE_id;
            parameters[1].Value = model.AEE_score;
            parameters[2].Value = model.AEE_sequence;
            parameters[3].Value = model.AEE_ranking;
            parameters[4].Value = model.Period_id;
            parameters[5].Value = model.User_id;
            int rows = DBSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(university.Model.CCOM.Examination_AEE_score model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Examination_AEE_score(");
            strSql.Append("AEE_score,AEE_sequence,AEE_ranking,Period_id,User_id");
            strSql.Append(") values (");
            strSql.Append("@AEE_score,@AEE_sequence,@AEE_ranking,@Period_id,@User_id");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AEE_score",    SqlDbType.Float,  8),
                new SqlParameter("@AEE_sequence", SqlDbType.Float,  8),
                new SqlParameter("@AEE_ranking",  SqlDbType.Int,    4),
                new SqlParameter("@Period_id",    SqlDbType.Int,    4),
                new SqlParameter("@User_id",      SqlDbType.BigInt, 8)
            };

            parameters[0].Value = model.AEE_score;
            parameters[1].Value = model.AEE_sequence;
            parameters[2].Value = model.AEE_ranking;
            parameters[3].Value = model.Period_id;
            parameters[4].Value = model.User_id;

            object obj = DBSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }