Beispiel #1
0
        public bool UpdateJournalSetInfo(JournalSetInfoEntity journalSetInfoEntity)
        {
            bool          flag             = false;
            StringBuilder whereCommandText = new StringBuilder();

            whereCommandText.Append("  SetID=@SetID");
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" JournalID=@JournalID");
            sqlCommandText.Append(", ApiSiteID=@ApiSiteID");
            sqlCommandText.Append(", DBServerID=@DBServerID");
            sqlCommandText.Append(", AddDate=@AddDate");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.JournalSetInfo SET {0} WHERE  {1}", sqlCommandText.ToString(), whereCommandText.ToString()));

            db.AddInParameter(cmd, "@SetID", DbType.Int32, journalSetInfoEntity.SetID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, journalSetInfoEntity.JournalID);
            db.AddInParameter(cmd, "@ApiSiteID", DbType.Int32, journalSetInfoEntity.ApiSiteID);
            db.AddInParameter(cmd, "@DBServerID", DbType.Int32, journalSetInfoEntity.DBServerID);
            db.AddInParameter(cmd, "@AddDate", DbType.DateTime, journalSetInfoEntity.AddDate);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
Beispiel #2
0
        public bool AddJournalSetInfo(JournalSetInfoEntity journalSetInfoEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" @SetID");
            sqlCommandText.Append(", @JournalID");
            sqlCommandText.Append(", @ApiSiteID");
            sqlCommandText.Append(", @DBServerID");
            sqlCommandText.Append(", @AddDate");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.JournalSetInfo ({0}) VALUES ({1})", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@SetID", DbType.Int32, journalSetInfoEntity.SetID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, journalSetInfoEntity.JournalID);
            db.AddInParameter(cmd, "@ApiSiteID", DbType.Int32, journalSetInfoEntity.ApiSiteID);
            db.AddInParameter(cmd, "@DBServerID", DbType.Int32, journalSetInfoEntity.DBServerID);
            db.AddInParameter(cmd, "@AddDate", DbType.DateTime, journalSetInfoEntity.AddDate);
            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
Beispiel #3
0
        public List <JournalSetInfoEntity> MakeJournalSetInfoList(DataTable dt)
        {
            List <JournalSetInfoEntity> list = new List <JournalSetInfoEntity>();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    JournalSetInfoEntity journalSetInfoEntity = MakeJournalSetInfo(dt.Rows[i]);
                    list.Add(journalSetInfoEntity);
                }
            }
            return(list);
        }
Beispiel #4
0
        public JournalSetInfoEntity MakeJournalSetInfo(DataRow dr)
        {
            JournalSetInfoEntity journalSetInfoEntity = null;

            if (dr != null)
            {
                journalSetInfoEntity            = new JournalSetInfoEntity();
                journalSetInfoEntity.SetID      = (Int32)dr["SetID"];
                journalSetInfoEntity.JournalID  = (Int64)dr["JournalID"];
                journalSetInfoEntity.ApiSiteID  = (Int32)dr["ApiSiteID"];
                journalSetInfoEntity.DBServerID = (Int32)dr["DBServerID"];
                journalSetInfoEntity.AddDate    = (DateTime)dr["AddDate"];
            }
            return(journalSetInfoEntity);
        }
Beispiel #5
0
        public JournalSetInfoEntity MakeJournalSetInfo(IDataReader dr)
        {
            JournalSetInfoEntity journalSetInfoEntity = null;

            if (dr.Read())
            {
                journalSetInfoEntity            = new JournalSetInfoEntity();
                journalSetInfoEntity.SetID      = (Int32)dr["SetID"];
                journalSetInfoEntity.JournalID  = (Int64)dr["JournalID"];
                journalSetInfoEntity.ApiSiteID  = (Int32)dr["ApiSiteID"];
                journalSetInfoEntity.DBServerID = (Int32)dr["DBServerID"];
                journalSetInfoEntity.AddDate    = (DateTime)dr["AddDate"];
            }
            dr.Close();
            return(journalSetInfoEntity);
        }
Beispiel #6
0
        public List <JournalSetInfoEntity> MakeJournalSetInfoList(IDataReader dr)
        {
            List <JournalSetInfoEntity> list = new List <JournalSetInfoEntity>();

            while (dr.Read())
            {
                JournalSetInfoEntity journalSetInfoEntity = new JournalSetInfoEntity();
                journalSetInfoEntity.SetID      = (Int32)dr["SetID"];
                journalSetInfoEntity.JournalID  = (Int64)dr["JournalID"];
                journalSetInfoEntity.ApiSiteID  = (Int32)dr["ApiSiteID"];
                journalSetInfoEntity.DBServerID = (Int32)dr["DBServerID"];
                journalSetInfoEntity.AddDate    = (DateTime)dr["AddDate"];
                list.Add(journalSetInfoEntity);
            }
            dr.Close();
            return(list);
        }
Beispiel #7
0
        public JournalSetInfoEntity GetJournalSetInfo(Int32 setID)
        {
            JournalSetInfoEntity journalSetInfoEntity = null;
            StringBuilder        sqlCommandText       = new StringBuilder();

            sqlCommandText.Append("SELECT TOP 1  SetID,JournalID,ApiSiteID,DBServerID,AddDate FROM dbo.JournalSetInfo WITH(NOLOCK)");
            sqlCommandText.Append(" WHERE  SetID=@SetID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@SetID", DbType.Int32, setID);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                journalSetInfoEntity = MakeJournalSetInfo(dr);
            }
            return(journalSetInfoEntity);
        }
Beispiel #8
0
        public bool DeleteJournalSetInfo(JournalSetInfoEntity journalSetInfoEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append("DELETE FROM dbo.JournalSetInfo");
            sqlCommandText.Append(" WHERE  SetID=@SetID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@SetID", DbType.Int32, journalSetInfoEntity.SetID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="journalSetInfo">JournalSetInfoEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddJournalSetInfo(JournalSetInfoEntity journalSetInfo)
 {
     return(JournalSetInfoDataAccess.Instance.AddJournalSetInfo(journalSetInfo));
 }
Beispiel #10
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="journalSetInfo">JournalSetInfoEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteJournalSetInfo(JournalSetInfoEntity journalSetInfo)
 {
     return(JournalSetInfoDataAccess.Instance.DeleteJournalSetInfo(journalSetInfo));
 }
Beispiel #11
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="journalSetInfo">JournalSetInfoEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteJournalSetInfo(JournalSetInfoEntity journalSetInfo)
 {
     return(JournalSetInfoBusProvider.DeleteJournalSetInfo(journalSetInfo));
 }
Beispiel #12
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="journalSetInfo">JournalSetInfoEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateJournalSetInfo(JournalSetInfoEntity journalSetInfo)
 {
     return(JournalSetInfoBusProvider.UpdateJournalSetInfo(journalSetInfo));
 }
Beispiel #13
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="journalSetInfo">JournalSetInfoEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddJournalSetInfo(JournalSetInfoEntity journalSetInfo)
 {
     return(JournalSetInfoBusProvider.AddJournalSetInfo(journalSetInfo));
 }