//========================================================================= // FunctionName : Modify /// <summary> /// 更新方法 /// </summary> /// <param name="appData">应用数据实体</param> /// <returns>返回数据实体对象</returns> //========================================================================= public T_BM_GZXXApplicationData Modify(T_BM_GZXXApplicationData appData) { T_BM_GZXXBusinessEntity instanceT_BM_GZXXBusinessEntity = (T_BM_GZXXBusinessEntity)CreateBusinessEntityInstance(typeof(T_BM_GZXXBusinessEntity)); instanceT_BM_GZXXBusinessEntity.AppData = appData; if (instanceT_BM_GZXXBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.PK) { if (instanceT_BM_GZXXBusinessEntity.IsExistByKey() == true) { instanceT_BM_GZXXBusinessEntity.UpdateByKey(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else { instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure; } } else if (instanceT_BM_GZXXBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ID) { if (instanceT_BM_GZXXBusinessEntity.IsExistByObjectID() == true) { instanceT_BM_GZXXBusinessEntity.UpdateByObjectID(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else { instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure; } } else if (instanceT_BM_GZXXBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.BATCH) { instanceT_BM_GZXXBusinessEntity.UpdateByObjectIDBatch(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else if (instanceT_BM_GZXXBusinessEntity.AppData.OPCode == ApplicationDataBase.OPType.ALL) { instanceT_BM_GZXXBusinessEntity.UpdateByAnyCondition(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else { if (instanceT_BM_GZXXBusinessEntity.IsExistByObjectID() == true) { instanceT_BM_GZXXBusinessEntity.UpdateByObjectID(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else { instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure; } } return(instanceT_BM_GZXXBusinessEntity.AppData); }
//========================================================================= // FunctionName : Add /// <summary> /// 添加方法 /// </summary> /// <param name="appData">应用数据实体</param> /// <returns>返回数据实体对象</returns> //========================================================================= public T_BM_GZXXApplicationData Add(T_BM_GZXXApplicationData appData) { T_BM_GZXXBusinessEntity instanceT_BM_GZXXBusinessEntity = (T_BM_GZXXBusinessEntity)CreateBusinessEntityInstance(typeof(T_BM_GZXXBusinessEntity)); instanceT_BM_GZXXBusinessEntity.AppData = appData; if (instanceT_BM_GZXXBusinessEntity.IsExistByKey() == false) { instanceT_BM_GZXXBusinessEntity.Insert(); instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Succeed; } else { instanceT_BM_GZXXBusinessEntity.AppData.ResultCode = ApplicationDataBase.ResultState.Failure; } return(instanceT_BM_GZXXBusinessEntity.AppData); }