///
        /// 插入一个HOSPITALINTRODUCTION实体到数据库。
        ///
        /// 将要插入的实体
        public int InsertEntity(DataSetHOSPITALINTRODUCTION entity)
        {
            CheckData(entity);
            int  iRtn         = 0;
            bool isExistTrans = db.IsInTransaction();

            if (!isExistTrans)
            {
                db.BeginTrans();
            }

            try
            {
                foreach (DataRow row in entity.Tables["YWAPP_HOSPITAL_INTRODUCTION"].Rows)
                {
                    int j = db.exeSql(new SS_HOSPITALINTRODUCTION_InsertYWAPP_HOSPITAL_INTRODUCTION(), row);
                    iRtn = iRtn + j;
                }

                if (!isExistTrans)
                {
                    db.CommitTrans();
                }
                return(iRtn);
            }
            catch (Exception e)
            {
                if (!isExistTrans)
                {
                    db.RollbackTrans();
                }
                throw e;
            }
        }
        /////////////
        #endregion

        //// 2006-09-11
        public DataSetHOSPITALINTRODUCTION GetDataSet(SqlClass sC, string sTableName)
        {
            DataSetHOSPITALINTRODUCTION ds = new  DataSetHOSPITALINTRODUCTION();

            db.FillDataSet(sC, ds, sTableName);
            return(ds);
        }
Beispiel #3
0
        ///
        /// 检查给定的实体是否有更改,如果有把更改的行提交到数据库。 注意:提交过程是按先提交Deleted的行,再提交Modified的行,最后提交Added的行。
        ///

        /// 要检验的实体
        public void CommitHOSPITALINTRODUCTIONChanges(DataSetHOSPITALINTRODUCTION entity, ArrayList alUpdateColumn, ArrayList alUpdateControl)
        {
            using (HOSPITALINTRODUCTIONBaseDAO dao = new HOSPITALINTRODUCTIONBaseDAO())
            {
                dao.CommitChanges(entity, alUpdateColumn, alUpdateControl);
            }
        }
Beispiel #4
0
        ///
        /// 检查给定的实体是否有更改,如果有把更改的行提交到数据库。 注意:提交过程是按先提交Deleted的行,再提交Modified的行,最后提交Added的行。
        ///

        /// 要检验的实体
        public void CommitHOSPITALINTRODUCTIONChanges(DataSetHOSPITALINTRODUCTION entity)
        {
            using (HOSPITALINTRODUCTIONBaseDAO dao = new HOSPITALINTRODUCTIONBaseDAO())
            {
                dao.CommitChanges(entity);
            }
        }
Beispiel #5
0
        ///
        /// 更新HOSPITALINTRODUCTION实体。
        ///

        /// HOSPITALINTRODUCTION实体

        public void UpdateHOSPITALINTRODUCTION(DataSetHOSPITALINTRODUCTION entity)
        {
            using (HOSPITALINTRODUCTIONBaseDAO dao = new HOSPITALINTRODUCTIONBaseDAO())
            {
                dao.UpdateEntity(entity);
            }
        }
Beispiel #6
0
        /*实体HOSPITALINTRODUCTION的基本规则*/
        ///
        /// 插入HOSPITALINTRODUCTION实体。
        ///

        /// HOSPITALINTRODUCTION实体

        public void InsertHOSPITALINTRODUCTION(DataSetHOSPITALINTRODUCTION entity)
        {
            using (HOSPITALINTRODUCTIONBaseDAO dao = new HOSPITALINTRODUCTIONBaseDAO())
            {
                dao.InsertEntity(entity);
            }
        }
        }         // Data_SelectByIDYWAPP_HOSPITAL_INTRODUCTION

        #endregion

        #region Data_HOSPITALINTRODUCTION_SelectAll
        ///
        /// 对于SelectAll的类的实现(数据库操作)。
        ///
        public DataSetHOSPITALINTRODUCTION  Data_HOSPITALINTRODUCTION_SelectAll(string sTj)
        {
            DataSetHOSPITALINTRODUCTION       ds = new DataSetHOSPITALINTRODUCTION();
            SS_HOSPITALINTRODUCTION_SelectAll ss = new SS_HOSPITALINTRODUCTION_SelectAll();

            ss.SqlString = ss.SqlString.Replace("1=1", sTj);

            db.FillDataSet(ss, ds, "YWAPP_HOSPITAL_INTRODUCTION");
            return(ds);
        }         // Data_SelectAll
        //wuqb modify 2007-03-27



        //强名DataSet

        #region Data_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION
        ///
        /// 对于SelectByIDYWAPP_HOSPITAL_INTRODUCTION的类的实现(数据库操作)。
        ///
        public DataSetHOSPITALINTRODUCTION  Data_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION(System.String ID)
        {
            DataSetHOSPITALINTRODUCTION ds = new DataSetHOSPITALINTRODUCTION();
            SS_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION ss = new SS_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION();

            ss.ID = ID;

            db.FillDataSet(ss, ds, "YWAPP_HOSPITAL_INTRODUCTION");
            return(ds);
        }         // Data_SelectByIDYWAPP_HOSPITAL_INTRODUCTION
        ///
        /// 检查给定的实体是否有给定状态的更改,如果有把更改的行提交到数据库。
        ///
        /// 要检验的实体
        /// 要检查更改的状态

        /// 2006-05-21
        public int CommitChanges(DataSetHOSPITALINTRODUCTION entity, DataRowState drs, ArrayList alUpdateColumn, ArrayList alUpdateControl)
        {
            db.SetUpdateControl(alUpdateControl);
            db.SetUpdateColumn(alUpdateColumn);
            int iRet = CommitChanges(entity, drs);

            db.SetUpdateControl(null);
            db.SetUpdateColumn(null);
            return(iRet);
        }
        ///
        /// 按照HOSPITALINTRODUCTION实体的主表的主键查询数据。
        ///
        /// 主键的值
        public DataSetHOSPITALINTRODUCTION FindByPrimaryKey(object KeyValue)
        {
            DataSetHOSPITALINTRODUCTION entity = new DataSetHOSPITALINTRODUCTION();
            SS_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION ss = new SS_HOSPITALINTRODUCTION_SelectByIDYWAPP_HOSPITAL_INTRODUCTION();

            ss.Params[0].Value = KeyValue;
            db.FillDataSet(ss, entity, "YWAPP_HOSPITAL_INTRODUCTION");

            return(entity);
        }
        /////////////////


        public int CommitChanges(DataSetHOSPITALINTRODUCTION entity, DataRowState drs)
        {
            int iRtn = 0;

            if (!entity.HasChanges(drs))
            {
                return(iRtn);
            }
            CheckData(entity);

            bool isExistTrans = db.IsInTransaction();

            if (!isExistTrans)
            {
                db.BeginTrans();
            }

            try
            {
                if (drs == DataRowState.Deleted)
                {
                    iRtn += DeleteEntity(entity.GetChangesEntity(drs));
                }
                else if (drs == DataRowState.Modified)
                {
                    iRtn += UpdateEntity(entity.GetChangesEntity(drs));
                }
                else if (drs == DataRowState.Added)
                {
                    iRtn += InsertEntity(entity.GetChangesEntity(drs));
                }
                if (!isExistTrans)
                {
                    db.CommitTrans();
                }
                return(iRtn);
            }
            catch (Exception e)
            {
                if (isExistTrans)
                {
                    db.RollbackTrans();
                }
                throw e;
            }
        }
        ///
        /// 检查给定的实体是否有更改,如果有把更改的行提交到数据库。
        ///
        /// 要检验的实体



        public int CommitChanges(DataSetHOSPITALINTRODUCTION entity)
        {
            int iRtn = 0;

            if (!entity.HasChanges())
            {
                return(iRtn);
            }
            CheckData(entity);

            bool isExistTrans = db.IsInTransaction();

            if (!isExistTrans)
            {
                db.BeginTrans();
            }

            try
            {
                //CommitChanges(entity, DataRowState.Deleted);
                //CommitChanges(entity, DataRowState.Modified);
                //CommitChanges(entity, DataRowState.Added);

                ////////// 2006-05-21
                iRtn += CommitChanges(entity, DataRowState.Deleted, null, null);
                iRtn += CommitChanges(entity, DataRowState.Modified, alUpdateColumn, alUpdateControl);
                iRtn += CommitChanges(entity, DataRowState.Added, null, null);
                /////////////

                if (!isExistTrans)
                {
                    db.CommitTrans();
                }
                return(iRtn);
            }
            catch (Exception e)
            {
                if (isExistTrans)
                {
                    db.RollbackTrans();
                }
                throw e;
            }
        }
 ///
 /// 校验数据输入的有效性。
 ///
 /// 要检验的实体
 protected void CheckData(DataSetHOSPITALINTRODUCTION entity)
 {
     //在这里可以加入操作之前所需要对实体检验的代码
 }
        /// 2006-05-21
        ///

        public int CommitChanges(DataSetHOSPITALINTRODUCTION entity, ArrayList alUpdateColumn, ArrayList alUpdateControl)
        {
            this.alUpdateColumn  = alUpdateColumn;
            this.alUpdateControl = alUpdateControl;
            return(CommitChanges(entity));
        }