/// <summary>
 /// 由一行数据得到一个实体
 /// </summary>
 private CoScheduling.Core.Model.BIGAREA_SATELLITE GetModel(DbDataReader dr)
 {
     CoScheduling.Core.Model.BIGAREA_SATELLITE model = new CoScheduling.Core.Model.BIGAREA_SATELLITE();
     model.SATELLITEID = Convert.ToDecimal(dr["SATELLITEID"]);
     model.SATID       = Convert.ToDecimal(dr["SATID"]);
     model.SCHEMEID    = Convert.ToDecimal(dr["SCHEMEID"]);
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(CoScheduling.Core.Model.BIGAREA_SATELLITE model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("INSERT INTO BIGAREA_SATELLITE(");
            strSql.Append("SATID,SCHEMEID)");
            strSql.Append(" VALUES (");
            strSql.Append("@in_SATID,@in_SCHEMEID)");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@in_SATID", SqlDbType.Decimal),
                new SqlParameter("@in_SCHEMEID", SqlDbType.Decimal)
            };
            cmdParms[0].Value = model.SATID;
            cmdParms[1].Value = model.SCHEMEID;
            return(DbHelperSQL.ExecuteSql(strSql.ToString(), cmdParms));
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CoScheduling.Core.Model.BIGAREA_SATELLITE GetModel(decimal SATELLITEID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT * FROM BIGAREA_SATELLITE ");
            strSql.Append(" WHERE SATELLITEID=" + SATELLITEID);
            CoScheduling.Core.Model.BIGAREA_SATELLITE model = new CoScheduling.Core.Model.BIGAREA_SATELLITE();
            using (DbDataReader dr = DbHelperSQL.ExecuteReader(strSql.ToString()))
            {
                while (dr.Read())
                {
                    model = GetModel(dr);
                }
                return(model);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(CoScheduling.Core.Model.BIGAREA_SATELLITE model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("UPDATE BIGAREA_SATELLITE SET ");
            strSql.Append("SATID=@in_SATID,");
            strSql.Append("SCHEMEID=@in_SCHEMEID");
            strSql.Append(" WHERE SATELLITEID=@in_SATELLITEID");
            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@in_SATID", SqlDbType.Decimal),
                new SqlParameter("@in_SCHEMEID", SqlDbType.Decimal),
                new SqlParameter("@in_SATELLITEID", SqlDbType.Decimal)
            };
            cmdParms[0].Value = model.SATID;
            cmdParms[1].Value = model.SCHEMEID;
            cmdParms[2].Value = model.SATELLITEID;
            return(DbHelperSQL.ExecuteSql(strSql.ToString(), cmdParms));
        }