コード例 #1
0
        //=========================================================================
        //  FunctionName : Query
        /// <summary>
        /// 检索方法
        /// </summary>
        /// <param name="appData">应用数据实体</param>
        /// <returns>返回数据实体对象</returns>
        //=========================================================================
        public T_PM_PurviewInfoApplicationData Query(T_PM_PurviewInfoApplicationData appData)
        {
            T_PM_PurviewInfoBusinessEntity instanceT_PM_PurviewInfoBusinessEntity = (T_PM_PurviewInfoBusinessEntity)CreateBusinessEntityInstance(typeof(T_PM_PurviewInfoBusinessEntity));

            instanceT_PM_PurviewInfoBusinessEntity.AppData = appData;
            if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.PK)
            {
                instanceT_PM_PurviewInfoBusinessEntity.SelectByKey();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ID)
            {
                instanceT_PM_PurviewInfoBusinessEntity.SelectByObjectID();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ALL)
            {
                instanceT_PM_PurviewInfoBusinessEntity.SelectByAnyCondition();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else
            {
                instanceT_PM_PurviewInfoBusinessEntity.SelectByAnyCondition();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            return(instanceT_PM_PurviewInfoBusinessEntity.AppData);
        }
コード例 #2
0
        //=========================================================================
        //  FunctionName : Count
        /// <summary>
        /// 统计记录数方法
        /// </summary>
        /// <param name="appData">应用数据实体</param>
        /// <returns>返回数据实体对象</returns>
        //=========================================================================
        public T_PM_PurviewInfoApplicationData Count(T_PM_PurviewInfoApplicationData appData)
        {
            T_PM_PurviewInfoBusinessEntity instanceT_PM_PurviewInfoBusinessEntity = (T_PM_PurviewInfoBusinessEntity)CreateBusinessEntityInstance(typeof(T_PM_PurviewInfoBusinessEntity));

            instanceT_PM_PurviewInfoBusinessEntity.AppData = appData;
            instanceT_PM_PurviewInfoBusinessEntity.CountByAnyCondition();
            instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            return(instanceT_PM_PurviewInfoBusinessEntity.AppData);
        }
コード例 #3
0
        //=========================================================================
        //  FunctionName : Modify
        /// <summary>
        /// 更新方法
        /// </summary>
        /// <param name="appData">应用数据实体</param>
        /// <returns>返回数据实体对象</returns>
        //=========================================================================
        public T_PM_PurviewInfoApplicationData Modify(T_PM_PurviewInfoApplicationData appData)
        {
            T_PM_PurviewInfoBusinessEntity instanceT_PM_PurviewInfoBusinessEntity = (T_PM_PurviewInfoBusinessEntity)CreateBusinessEntityInstance(typeof(T_PM_PurviewInfoBusinessEntity));

            instanceT_PM_PurviewInfoBusinessEntity.AppData = appData;
            if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.PK)
            {
                if (instanceT_PM_PurviewInfoBusinessEntity.IsExistByKey() == true)
                {
                    instanceT_PM_PurviewInfoBusinessEntity.UpdateByKey();
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
                }
                else
                {
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure;
                }
            }
            else if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ID)
            {
                if (instanceT_PM_PurviewInfoBusinessEntity.IsExistByObjectID() == true)
                {
                    instanceT_PM_PurviewInfoBusinessEntity.UpdateByObjectID();
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
                }
                else
                {
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure;
                }
            }
            else if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.BATCH)
            {
                instanceT_PM_PurviewInfoBusinessEntity.UpdateByObjectIDBatch();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else if (instanceT_PM_PurviewInfoBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ALL)
            {
                instanceT_PM_PurviewInfoBusinessEntity.UpdateByAnyCondition();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else
            {
                if (instanceT_PM_PurviewInfoBusinessEntity.IsExistByObjectID() == true)
                {
                    instanceT_PM_PurviewInfoBusinessEntity.UpdateByObjectID();
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
                }
                else
                {
                    instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure;
                }
            }
            return(instanceT_PM_PurviewInfoBusinessEntity.AppData);
        }
コード例 #4
0
        //=====================================================================
        //  FunctionName : GetDataByObjectID
        /// <summary>
        /// 以ObjectID为条件查询记录并返回AppData
        /// </summary>
        //=====================================================================
        public static T_PM_PurviewInfoApplicationData GetDataByObjectID(string strObjectID)
        {
            // 创建数据库连接
            Database  db          = DatabaseFactory.CreateDatabase("strConnManager");
            string    strProcName = "SP_SelectT_PM_PurviewInfoByObjectID";
            DbCommand cmdProc     = db.GetStoredProcCommand(strProcName);

            // 设定存储过程输入参数
            db.AddInParameter(cmdProc, "@ObjectID", DbType.String);
            // 对存储过程参数赋值
            db.SetParameterValue(cmdProc, "@ObjectID", strObjectID);
            // 执行存储过程
            return(T_PM_PurviewInfoApplicationData.FillDataFromDataReader(db.ExecuteReader(cmdProc)));
        }
コード例 #5
0
        //=========================================================================
        //  FunctionName : Add
        /// <summary>
        /// 添加方法
        /// </summary>
        /// <param name="appData">应用数据实体</param>
        /// <returns>返回数据实体对象</returns>
        //=========================================================================
        public T_PM_PurviewInfoApplicationData Add(T_PM_PurviewInfoApplicationData appData)
        {
            T_PM_PurviewInfoBusinessEntity instanceT_PM_PurviewInfoBusinessEntity = (T_PM_PurviewInfoBusinessEntity)CreateBusinessEntityInstance(typeof(T_PM_PurviewInfoBusinessEntity));

            instanceT_PM_PurviewInfoBusinessEntity.AppData = appData;
            if (instanceT_PM_PurviewInfoBusinessEntity.IsExistByKey() == false)
            {
                instanceT_PM_PurviewInfoBusinessEntity.Insert();
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed;
            }
            else
            {
                instanceT_PM_PurviewInfoBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure;
            }
            return(instanceT_PM_PurviewInfoBusinessEntity.AppData);
        }
コード例 #6
0
        public static IEnumerable <T_PM_PurviewInfoApplicationData> GetCollectionFromImportDataTable(DataTable dt)
        {
            List <T_PM_PurviewInfoApplicationData> collection = new List <T_PM_PurviewInfoApplicationData>();

            foreach (DataRow dr in dt.Rows)
            {
                T_PM_PurviewInfoApplicationData applicationData = new T_PM_PurviewInfoApplicationData()
                {
                    ObjectID          = (dr.ReadGuidNullable("ObjectID") == null ? null : dr.ReadGuidNullable("ObjectID").ToString()),
                    PurviewID         = dr.ReadString("PurviewID"),
                    PurviewName       = dr.ReadString("PurviewName"),
                    PurviewTypeID     = dr.ReadString("PurviewTypeID"),
                    PurviewContent    = dr.ReadString("PurviewContent"),
                    PurviewRemark     = dr.ReadString("PurviewRemark"),
                    IsPageMenu        = dr.ReadBooleanNullable("IsPageMenu"),
                    PageFileName      = dr.ReadString("PageFileName"),
                    PageFileParameter = dr.ReadString("PageFileParameter"),
                    PageFilePath      = dr.ReadString("PageFilePath"),
                    UpdateDate        = dr.ReadDateTimeNullable("UpdateDate"),
                };
                collection.Add(applicationData);
            }
            return(collection);
        }