//========================================================================= // 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); }
//========================================================================= // 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); }