/// <summary> /// Insert /// </summary> public Plat_util_CodeBase Insert(Plat_util_CodeBase entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPlat_util_CodeBase Plat_util_CodeBaseEntity = entity as PersistentPlat_util_CodeBase; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(Plat_util_CodeBaseDAO.SqlInsert); db.AddInParameter(dbCommand, "@CodeBaseGuid", DbType.Guid, Plat_util_CodeBaseEntity.CodeBaseGuid); db.AddInParameter(dbCommand, "@CodeBaseCode", DbType.String, Plat_util_CodeBaseEntity.CodeBaseCode); db.AddInParameter(dbCommand, "@CodeBaseName", DbType.String, Plat_util_CodeBaseEntity.CodeBaseName); db.AddInParameter(dbCommand, "@CodeBaseType", DbType.String, Plat_util_CodeBaseEntity.CodeBaseType); db.AddInParameter(dbCommand, "@CodeBaseDesc", DbType.String, Plat_util_CodeBaseEntity.CodeBaseDesc); db.AddInParameter(dbCommand, "@OnModuleGuid", DbType.Guid, Plat_util_CodeBaseEntity.OnModuleGuid); db.AddInParameter(dbCommand, "@ParentCodeBaseGuid", DbType.Guid, Plat_util_CodeBaseEntity.ParentCodeBaseGuid); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, Plat_util_CodeBaseEntity.IsActive); db.AddInParameter(dbCommand, "@MyMark", DbType.Int32, Plat_util_CodeBaseEntity.MyMark); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(Plat_util_CodeBaseEntity as Plat_util_CodeBase); }
private void UpdateAll(Plat_util_CodeBase entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPlat_util_CodeBase Plat_util_CodeBaseEntity = entity as PersistentPlat_util_CodeBase; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(Plat_util_CodeBaseDAO.SqlUpdate); db.AddInParameter(dbCommand, "@CodeBaseGuid", DbType.Guid, Plat_util_CodeBaseEntity.CodeBaseGuid); db.AddInParameter(dbCommand, "@CodeBaseCode", DbType.String, Plat_util_CodeBaseEntity.CodeBaseCode); db.AddInParameter(dbCommand, "@CodeBaseName", DbType.String, Plat_util_CodeBaseEntity.CodeBaseName); db.AddInParameter(dbCommand, "@CodeBaseType", DbType.String, Plat_util_CodeBaseEntity.CodeBaseType); db.AddInParameter(dbCommand, "@CodeBaseDesc", DbType.String, Plat_util_CodeBaseEntity.CodeBaseDesc); db.AddInParameter(dbCommand, "@OnModuleGuid", DbType.Guid, Plat_util_CodeBaseEntity.OnModuleGuid); db.AddInParameter(dbCommand, "@ParentCodeBaseGuid", DbType.Guid, Plat_util_CodeBaseEntity.ParentCodeBaseGuid); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, Plat_util_CodeBaseEntity.IsActive); db.AddInParameter(dbCommand, "@MyMark", DbType.Int32, Plat_util_CodeBaseEntity.MyMark); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(PM_ALT_CRITERION_AGGR entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_CRITERION_AGGR PM_ALT_CRITERION_AGGREntity = entity as PersistentPM_ALT_CRITERION_AGGR; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_CRITERION_AGGRDAO.SqlUpdate); db.AddInParameter(dbCommand, "@AggregationID", DbType.Guid, PM_ALT_CRITERION_AGGREntity.AggregationID); db.AddInParameter(dbCommand, "@AlertID", DbType.Guid, PM_ALT_CRITERION_AGGREntity.AlertID); db.AddInParameter(dbCommand, "@Element", DbType.String, PM_ALT_CRITERION_AGGREntity.Element); db.AddInParameter(dbCommand, "@Alias", DbType.String, PM_ALT_CRITERION_AGGREntity.Alias); db.AddInParameter(dbCommand, "@Sequence", DbType.Int32, PM_ALT_CRITERION_AGGREntity.Sequence); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, PM_ALT_CRITERION_AGGREntity.IsActive); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_CRITERION_AGGREntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_CRITERION_AGGREntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_CRITERION_AGGREntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_CRITERION_AGGREntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_CRITERION_AGGREntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(PM_ALT_EVENT_LOG entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_EVENT_LOG PM_ALT_EVENT_LOGEntity = entity as PersistentPM_ALT_EVENT_LOG; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_LOGDAO.SqlUpdate); db.AddInParameter(dbCommand, "@EventLogID", DbType.Guid, PM_ALT_EVENT_LOGEntity.EventLogID); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, PM_ALT_EVENT_LOGEntity.EventTypeID); db.AddInParameter(dbCommand, "@EventBrief", DbType.String, PM_ALT_EVENT_LOGEntity.EventBrief); db.AddInParameter(dbCommand, "@EventContent", DbType.String, PM_ALT_EVENT_LOGEntity.EventContent); db.AddInParameter(dbCommand, "@Attachments", DbType.String, PM_ALT_EVENT_LOGEntity.Attachments); db.AddInParameter(dbCommand, "@NotifiedCnt", DbType.Int32, PM_ALT_EVENT_LOGEntity.NotifiedCnt); db.AddInParameter(dbCommand, "@IsFinished", DbType.Boolean, PM_ALT_EVENT_LOGEntity.IsFinished); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_EVENT_LOGEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_EVENT_LOGEntity.CreatedOn); db.AddInParameter(dbCommand, "@NotifiedBy", DbType.String, PM_ALT_EVENT_LOGEntity.NotifiedBy); db.AddInParameter(dbCommand, "@NotifiedOn", DbType.DateTime, PM_ALT_EVENT_LOGEntity.NotifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
/// <summary> /// Insert with transaction /// </summary> public PM_ALT_EVENT_TYPE Insert(PM_ALT_EVENT_TYPE entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_EVENT_TYPE PM_ALT_EVENT_TYPEEntity = entity as PersistentPM_ALT_EVENT_TYPE; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_TYPEDAO.SqlInsert); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, PM_ALT_EVENT_TYPEEntity.EventTypeID); db.AddInParameter(dbCommand, "@EventTypeName", DbType.String, PM_ALT_EVENT_TYPEEntity.EventTypeName); db.AddInParameter(dbCommand, "@EventTypeDesc", DbType.String, PM_ALT_EVENT_TYPEEntity.EventTypeDesc); db.AddInParameter(dbCommand, "@EventPriority", DbType.Int32, PM_ALT_EVENT_TYPEEntity.EventPriority); db.AddInParameter(dbCommand, "@EventBrief", DbType.String, PM_ALT_EVENT_TYPEEntity.EventBrief); db.AddInParameter(dbCommand, "@EventContent", DbType.String, PM_ALT_EVENT_TYPEEntity.EventContent); db.AddInParameter(dbCommand, "@NotiCnt", DbType.Int32, PM_ALT_EVENT_TYPEEntity.NotiCnt); db.AddInParameter(dbCommand, "@Category", DbType.String, PM_ALT_EVENT_TYPEEntity.Category); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_EVENT_TYPEEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_EVENT_TYPEEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_EVENT_TYPEEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_EVENT_TYPEEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_EVENT_TYPEEntity as PM_ALT_EVENT_TYPE); }
private void UpdateAll(PM_ALT_EVENT_TYPE entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_EVENT_TYPE PM_ALT_EVENT_TYPEEntity = entity as PersistentPM_ALT_EVENT_TYPE; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_TYPEDAO.SqlUpdate); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, PM_ALT_EVENT_TYPEEntity.EventTypeID); db.AddInParameter(dbCommand, "@EventTypeName", DbType.String, PM_ALT_EVENT_TYPEEntity.EventTypeName); db.AddInParameter(dbCommand, "@EventTypeDesc", DbType.String, PM_ALT_EVENT_TYPEEntity.EventTypeDesc); db.AddInParameter(dbCommand, "@EventPriority", DbType.Int32, PM_ALT_EVENT_TYPEEntity.EventPriority); db.AddInParameter(dbCommand, "@EventBrief", DbType.String, PM_ALT_EVENT_TYPEEntity.EventBrief); db.AddInParameter(dbCommand, "@EventContent", DbType.String, PM_ALT_EVENT_TYPEEntity.EventContent); db.AddInParameter(dbCommand, "@NotiCnt", DbType.Int32, PM_ALT_EVENT_TYPEEntity.NotiCnt); db.AddInParameter(dbCommand, "@Category", DbType.String, PM_ALT_EVENT_TYPEEntity.Category); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_EVENT_TYPEEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_EVENT_TYPEEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_EVENT_TYPEEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_EVENT_TYPEEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
/// <summary> /// Insert with transaction /// </summary> public Plat_util_CodeDetail Insert(Plat_util_CodeDetail entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPlat_util_CodeDetail Plat_util_CodeDetailEntity = entity as PersistentPlat_util_CodeDetail; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(Plat_util_CodeDetailDAO.SqlInsert); db.AddInParameter(dbCommand, "@CodeDetailGuid", DbType.Guid, Plat_util_CodeDetailEntity.CodeDetailGuid); db.AddInParameter(dbCommand, "@CodeBaseCode", DbType.String, Plat_util_CodeDetailEntity.CodeBaseCode); db.AddInParameter(dbCommand, "@CodeDetailCode", DbType.String, Plat_util_CodeDetailEntity.CodeDetailCode); db.AddInParameter(dbCommand, "@CodeDetailName", DbType.String, Plat_util_CodeDetailEntity.CodeDetailName); db.AddInParameter(dbCommand, "@CodeDetailDesc", DbType.String, Plat_util_CodeDetailEntity.CodeDetailDesc); db.AddInParameter(dbCommand, "@CodeDetailValue", DbType.String, Plat_util_CodeDetailEntity.CodeDetailValue); db.AddInParameter(dbCommand, "@MySequence", DbType.Int32, Plat_util_CodeDetailEntity.MySequence); db.AddInParameter(dbCommand, "@IsDefault", DbType.Boolean, Plat_util_CodeDetailEntity.IsDefault); db.AddInParameter(dbCommand, "@IsDisplay", DbType.Boolean, Plat_util_CodeDetailEntity.IsDisplay); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, Plat_util_CodeDetailEntity.IsActive); int result = db.ExecuteNonQuery(dbCommand, transaction); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(Plat_util_CodeDetailEntity as Plat_util_CodeDetail); }
/// <summary> /// Insert /// </summary> public PM_ALT_SCALE Insert(PM_ALT_SCALE entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_SCALE PM_ALT_SCALEEntity = entity as PersistentPM_ALT_SCALE; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_SCALEDAO.SqlInsert); db.AddInParameter(dbCommand, "@CriterionID", DbType.Guid, PM_ALT_SCALEEntity.CriterionID); db.AddInParameter(dbCommand, "@Scales", DbType.String, PM_ALT_SCALEEntity.Scales); db.AddInParameter(dbCommand, "@ScaledValue", DbType.String, PM_ALT_SCALEEntity.ScaledValue); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_SCALEEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_SCALEEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_SCALEEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_SCALEEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_SCALEEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_SCALEEntity as PM_ALT_SCALE); }
/// <summary> /// Insert with transaction /// </summary> public PM_ALT_ELEMENT Insert(PM_ALT_ELEMENT entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_ELEMENT PM_ALT_ELEMENTEntity = entity as PersistentPM_ALT_ELEMENT; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_ELEMENTDAO.SqlInsert); db.AddInParameter(dbCommand, "@ElementID", DbType.Guid, PM_ALT_ELEMENTEntity.ElementID); db.AddInParameter(dbCommand, "@AlertID", DbType.Guid, PM_ALT_ELEMENTEntity.AlertID); db.AddInParameter(dbCommand, "@ElementField", DbType.String, PM_ALT_ELEMENTEntity.ElementField); db.AddInParameter(dbCommand, "@ElementAlias", DbType.String, PM_ALT_ELEMENTEntity.ElementAlias); db.AddInParameter(dbCommand, "@ElementType", DbType.String, PM_ALT_ELEMENTEntity.ElementType); db.AddInParameter(dbCommand, "@Sequence", DbType.Int32, PM_ALT_ELEMENTEntity.Sequence); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, PM_ALT_ELEMENTEntity.IsActive); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_ELEMENTEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_ELEMENTEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_ELEMENTEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_ELEMENTEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_ELEMENTEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_ELEMENTEntity as PM_ALT_ELEMENT); }
/// <summary> /// Insert /// </summary> public PM_ALT_CRITERION_COND Insert(PM_ALT_CRITERION_COND entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_CRITERION_COND PM_ALT_CRITERION_CONDEntity = entity as PersistentPM_ALT_CRITERION_COND; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_CRITERION_CONDDAO.SqlInsert); db.AddInParameter(dbCommand, "@ConditionID", DbType.Guid, PM_ALT_CRITERION_CONDEntity.ConditionID); db.AddInParameter(dbCommand, "@AlertID", DbType.Guid, PM_ALT_CRITERION_CONDEntity.AlertID); db.AddInParameter(dbCommand, "@Relation", DbType.String, PM_ALT_CRITERION_CONDEntity.Relation); db.AddInParameter(dbCommand, "@Element", DbType.String, PM_ALT_CRITERION_CONDEntity.Element); db.AddInParameter(dbCommand, "@Operator", DbType.String, PM_ALT_CRITERION_CONDEntity.Operator); db.AddInParameter(dbCommand, "@Value", DbType.String, PM_ALT_CRITERION_CONDEntity.Value); db.AddInParameter(dbCommand, "@Sequence", DbType.Int32, PM_ALT_CRITERION_CONDEntity.Sequence); db.AddInParameter(dbCommand, "@ParentID", DbType.Guid, PM_ALT_CRITERION_CONDEntity.ParentID); db.AddInParameter(dbCommand, "@CondLevel", DbType.Int32, PM_ALT_CRITERION_CONDEntity.CondLevel); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, PM_ALT_CRITERION_CONDEntity.IsActive); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_CRITERION_CONDEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_CRITERION_CONDEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_CRITERION_CONDEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_CRITERION_CONDEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_CRITERION_CONDEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_CRITERION_CONDEntity as PM_ALT_CRITERION_COND); }
private void UpdateAll(PM_ALT_NOTI_GROUP_DETAIL entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_NOTI_GROUP_DETAIL PM_ALT_NOTI_GROUP_DETAILEntity = entity as PersistentPM_ALT_NOTI_GROUP_DETAIL; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTI_GROUP_DETAILDAO.SqlUpdate); db.AddInParameter(dbCommand, "@NotiGroupDetailID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.NotiGroupDetailID); db.AddInParameter(dbCommand, "@NotiGroupID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.NotiGroupID); db.AddInParameter(dbCommand, "@SubGroupID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.SubGroupID); db.AddInParameter(dbCommand, "@MemberID", DbType.String, PM_ALT_NOTI_GROUP_DETAILEntity.MemberID); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_NOTI_GROUP_DETAILEntity.RowDeleted); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
/// <summary> /// Insert /// </summary> public PM_ALT_NOTI_GROUP_DETAIL Insert(PM_ALT_NOTI_GROUP_DETAIL entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_NOTI_GROUP_DETAIL PM_ALT_NOTI_GROUP_DETAILEntity = entity as PersistentPM_ALT_NOTI_GROUP_DETAIL; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTI_GROUP_DETAILDAO.SqlInsert); db.AddInParameter(dbCommand, "@NotiGroupDetailID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.NotiGroupDetailID); db.AddInParameter(dbCommand, "@NotiGroupID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.NotiGroupID); db.AddInParameter(dbCommand, "@SubGroupID", DbType.Guid, PM_ALT_NOTI_GROUP_DETAILEntity.SubGroupID); db.AddInParameter(dbCommand, "@MemberID", DbType.String, PM_ALT_NOTI_GROUP_DETAILEntity.MemberID); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_NOTI_GROUP_DETAILEntity.RowDeleted); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_NOTI_GROUP_DETAILEntity as PM_ALT_NOTI_GROUP_DETAIL); }
private void UpdateAll(PM_ALT_EVENT_TYPE_GRP entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_EVENT_TYPE_GRP PM_ALT_EVENT_TYPE_GRPEntity = entity as PersistentPM_ALT_EVENT_TYPE_GRP; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_TYPE_GRPDAO.SqlUpdate); db.AddInParameter(dbCommand, "@NotiEventGroupID", DbType.Guid, PM_ALT_EVENT_TYPE_GRPEntity.NotiEventGroupID); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, PM_ALT_EVENT_TYPE_GRPEntity.EventTypeID); db.AddInParameter(dbCommand, "@NotiGroupID", DbType.Guid, PM_ALT_EVENT_TYPE_GRPEntity.NotiGroupID); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(PM_ALT_NOTI entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_NOTI PM_ALT_NOTIEntity = entity as PersistentPM_ALT_NOTI; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTIDAO.SqlUpdate); db.AddInParameter(dbCommand, "@NotiGuid", DbType.Guid, PM_ALT_NOTIEntity.NotiGuid); db.AddInParameter(dbCommand, "@AlertID", DbType.Guid, PM_ALT_NOTIEntity.AlertID); db.AddInParameter(dbCommand, "@UserGuid", DbType.Guid, PM_ALT_NOTIEntity.UserGuid); db.AddInParameter(dbCommand, "@DepartmentGuid", DbType.Guid, PM_ALT_NOTIEntity.DepartmentGuid); db.AddInParameter(dbCommand, "@AgentGuid", DbType.Guid, PM_ALT_NOTIEntity.AgentGuid); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_NOTIEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_NOTIEntity.CreatedOn); db.AddInParameter(dbCommand, "@UpdatedBy", DbType.String, PM_ALT_NOTIEntity.UpdatedBy); db.AddInParameter(dbCommand, "@UpdatedOn", DbType.DateTime, PM_ALT_NOTIEntity.UpdatedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(Plat_util_CodeDetail entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPlat_util_CodeDetail Plat_util_CodeDetailEntity = entity as PersistentPlat_util_CodeDetail; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(Plat_util_CodeDetailDAO.SqlUpdate); db.AddInParameter(dbCommand, "@CodeDetailGuid", DbType.Guid, Plat_util_CodeDetailEntity.CodeDetailGuid); db.AddInParameter(dbCommand, "@CodeBaseCode", DbType.String, Plat_util_CodeDetailEntity.CodeBaseCode); db.AddInParameter(dbCommand, "@CodeDetailCode", DbType.String, Plat_util_CodeDetailEntity.CodeDetailCode); db.AddInParameter(dbCommand, "@CodeDetailName", DbType.String, Plat_util_CodeDetailEntity.CodeDetailName); db.AddInParameter(dbCommand, "@CodeDetailDesc", DbType.String, Plat_util_CodeDetailEntity.CodeDetailDesc); db.AddInParameter(dbCommand, "@CodeDetailValue", DbType.String, Plat_util_CodeDetailEntity.CodeDetailValue); db.AddInParameter(dbCommand, "@MySequence", DbType.Int32, Plat_util_CodeDetailEntity.MySequence); db.AddInParameter(dbCommand, "@IsDefault", DbType.Boolean, Plat_util_CodeDetailEntity.IsDefault); db.AddInParameter(dbCommand, "@IsDisplay", DbType.Boolean, Plat_util_CodeDetailEntity.IsDisplay); db.AddInParameter(dbCommand, "@IsActive", DbType.Boolean, Plat_util_CodeDetailEntity.IsActive); int result = db.ExecuteNonQuery(dbCommand); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(PM_ALT_NOTI_GROUP entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_NOTI_GROUP PM_ALT_NOTI_GROUPEntity = entity as PersistentPM_ALT_NOTI_GROUP; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTI_GROUPDAO.SqlUpdate); db.AddInParameter(dbCommand, "@NotiGroupID", DbType.Guid, PM_ALT_NOTI_GROUPEntity.NotiGroupID); db.AddInParameter(dbCommand, "@GroupName", DbType.String, PM_ALT_NOTI_GROUPEntity.GroupName); db.AddInParameter(dbCommand, "@GroupDesc", DbType.String, PM_ALT_NOTI_GROUPEntity.GroupDesc); db.AddInParameter(dbCommand, "@NotiEmail", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.NotiEmail); db.AddInParameter(dbCommand, "@NotiSMS", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.NotiSMS); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_NOTI_GROUPEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_NOTI_GROUPEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_NOTI_GROUPEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_NOTI_GROUPEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
/// <summary> /// Insert with transaction /// </summary> public PM_ALT_CONFIG_KEY Insert(PM_ALT_CONFIG_KEY entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_CONFIG_KEY PM_ALT_CONFIG_KEYEntity = entity as PersistentPM_ALT_CONFIG_KEY; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_CONFIG_KEYDAO.SqlInsert); db.AddInParameter(dbCommand, "@sOwner", DbType.String, PM_ALT_CONFIG_KEYEntity.sOwner); db.AddInParameter(dbCommand, "@sKey", DbType.String, PM_ALT_CONFIG_KEYEntity.sKey); db.AddInParameter(dbCommand, "@sValue", DbType.String, PM_ALT_CONFIG_KEYEntity.sValue); db.AddInParameter(dbCommand, "@sDescription", DbType.String, PM_ALT_CONFIG_KEYEntity.sDescription); int result = db.ExecuteNonQuery(dbCommand, transaction); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_CONFIG_KEYEntity as PM_ALT_CONFIG_KEY); }
private void UpdateAll(PM_ALT_SCALE entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_SCALE PM_ALT_SCALEEntity = entity as PersistentPM_ALT_SCALE; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_SCALEDAO.SqlUpdate); db.AddInParameter(dbCommand, "@ScalePK", DbType.Int64, PM_ALT_SCALEEntity.ScalePK); db.AddInParameter(dbCommand, "@CriterionID", DbType.Guid, PM_ALT_SCALEEntity.CriterionID); db.AddInParameter(dbCommand, "@Scales", DbType.String, PM_ALT_SCALEEntity.Scales); db.AddInParameter(dbCommand, "@ScaledValue", DbType.String, PM_ALT_SCALEEntity.ScaledValue); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_SCALEEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_SCALEEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_SCALEEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_SCALEEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_SCALEEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
private void UpdateAll(PM_ALT_CONFIG_KEY entity, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entity, "entity"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PersistentPM_ALT_CONFIG_KEY PM_ALT_CONFIG_KEYEntity = entity as PersistentPM_ALT_CONFIG_KEY; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_CONFIG_KEYDAO.SqlUpdate); db.AddInParameter(dbCommand, "@ID", DbType.Int32, PM_ALT_CONFIG_KEYEntity.ID); db.AddInParameter(dbCommand, "@sOwner", DbType.String, PM_ALT_CONFIG_KEYEntity.sOwner); db.AddInParameter(dbCommand, "@sKey", DbType.String, PM_ALT_CONFIG_KEYEntity.sKey); db.AddInParameter(dbCommand, "@sValue", DbType.String, PM_ALT_CONFIG_KEYEntity.sValue); db.AddInParameter(dbCommand, "@sDescription", DbType.String, PM_ALT_CONFIG_KEYEntity.sDescription); int result = db.ExecuteNonQuery(dbCommand, transaction); if (result == 0) { throw new EntityNotFoundException(); } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } }
/// <summary> /// Get /// </summary> public PM_ALT_EVENT_TYPE Get(object entityId) { ArgumentValidator.CheckForNullArgument(entityId, "entityId"); PM_ALT_EVENT_TYPE PM_ALT_EVENT_TYPEEntity = null; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_TYPEDAO.SqlGet); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, entityId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { PM_ALT_EVENT_TYPEEntity = ReadEntity(dataReader); } } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_EVENT_TYPEEntity); }
/// <summary> /// Insert /// </summary> public PM_ALT_EVENT_LOG Insert(PM_ALT_EVENT_LOG entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_EVENT_LOG PM_ALT_EVENT_LOGEntity = entity as PersistentPM_ALT_EVENT_LOG; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_EVENT_LOGDAO.SqlInsert); db.AddInParameter(dbCommand, "@EventLogID", DbType.Guid, PM_ALT_EVENT_LOGEntity.EventLogID); db.AddInParameter(dbCommand, "@EventTypeID", DbType.Guid, PM_ALT_EVENT_LOGEntity.EventTypeID); db.AddInParameter(dbCommand, "@EventBrief", DbType.String, PM_ALT_EVENT_LOGEntity.EventBrief); db.AddInParameter(dbCommand, "@EventContent", DbType.String, PM_ALT_EVENT_LOGEntity.EventContent); db.AddInParameter(dbCommand, "@Attachments", DbType.String, PM_ALT_EVENT_LOGEntity.Attachments); db.AddInParameter(dbCommand, "@NotifiedCnt", DbType.Int32, PM_ALT_EVENT_LOGEntity.NotifiedCnt); db.AddInParameter(dbCommand, "@IsFinished", DbType.Boolean, PM_ALT_EVENT_LOGEntity.IsFinished); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_EVENT_LOGEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_EVENT_LOGEntity.CreatedOn); db.AddInParameter(dbCommand, "@NotifiedBy", DbType.String, PM_ALT_EVENT_LOGEntity.NotifiedBy); db.AddInParameter(dbCommand, "@NotifiedOn", DbType.DateTime, PM_ALT_EVENT_LOGEntity.NotifiedOn); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_EVENT_LOGEntity as PM_ALT_EVENT_LOG); }
/// <summary> /// Get with transaction /// </summary> public PM_ALT_CRITERION_AGGR Get(object entityId, DbTransaction transaction) { ArgumentValidator.CheckForNullArgument(entityId, "entityId"); ArgumentValidator.CheckForNullArgument(transaction, "transaction"); PM_ALT_CRITERION_AGGR PM_ALT_CRITERION_AGGREntity = null; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_CRITERION_AGGRDAO.SqlGet); db.AddInParameter(dbCommand, "@AggregationID", DbType.Guid, entityId); using (IDataReader dataReader = db.ExecuteReader(dbCommand, transaction)) { if (dataReader.Read()) { PM_ALT_CRITERION_AGGREntity = ReadEntity(dataReader); } } } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_CRITERION_AGGREntity); }
/// <summary> /// Insert /// </summary> public PM_ALT_NOTI_GROUP Insert(PM_ALT_NOTI_GROUP entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_NOTI_GROUP PM_ALT_NOTI_GROUPEntity = entity as PersistentPM_ALT_NOTI_GROUP; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTI_GROUPDAO.SqlInsert); db.AddInParameter(dbCommand, "@NotiGroupID", DbType.Guid, PM_ALT_NOTI_GROUPEntity.NotiGroupID); db.AddInParameter(dbCommand, "@GroupName", DbType.String, PM_ALT_NOTI_GROUPEntity.GroupName); db.AddInParameter(dbCommand, "@GroupDesc", DbType.String, PM_ALT_NOTI_GROUPEntity.GroupDesc); db.AddInParameter(dbCommand, "@NotiEmail", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.NotiEmail); db.AddInParameter(dbCommand, "@NotiSMS", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.NotiSMS); db.AddInParameter(dbCommand, "@RowDeleted", DbType.Boolean, PM_ALT_NOTI_GROUPEntity.RowDeleted); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_NOTI_GROUPEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_NOTI_GROUPEntity.CreatedOn); db.AddInParameter(dbCommand, "@ModifiedBy", DbType.String, PM_ALT_NOTI_GROUPEntity.ModifiedBy); db.AddInParameter(dbCommand, "@ModifiedOn", DbType.DateTime, PM_ALT_NOTI_GROUPEntity.ModifiedOn); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_NOTI_GROUPEntity as PM_ALT_NOTI_GROUP); }
/// <summary> /// Insert /// </summary> public PM_ALT_NOTI Insert(PM_ALT_NOTI entity) { ArgumentValidator.CheckForNullArgument(entity, "entity"); PersistentPM_ALT_NOTI PM_ALT_NOTIEntity = entity as PersistentPM_ALT_NOTI; try { Database db = GetDatabaseInstance(); DbCommand dbCommand = db.GetSqlStringCommand(PM_ALT_NOTIDAO.SqlInsert); db.AddInParameter(dbCommand, "@NotiGuid", DbType.Guid, PM_ALT_NOTIEntity.NotiGuid); db.AddInParameter(dbCommand, "@AlertID", DbType.Guid, PM_ALT_NOTIEntity.AlertID); db.AddInParameter(dbCommand, "@UserGuid", DbType.Guid, PM_ALT_NOTIEntity.UserGuid); db.AddInParameter(dbCommand, "@DepartmentGuid", DbType.Guid, PM_ALT_NOTIEntity.DepartmentGuid); db.AddInParameter(dbCommand, "@AgentGuid", DbType.Guid, PM_ALT_NOTIEntity.AgentGuid); db.AddInParameter(dbCommand, "@CreatedBy", DbType.String, PM_ALT_NOTIEntity.CreatedBy); db.AddInParameter(dbCommand, "@CreatedOn", DbType.DateTime, PM_ALT_NOTIEntity.CreatedOn); db.AddInParameter(dbCommand, "@UpdatedBy", DbType.String, PM_ALT_NOTIEntity.UpdatedBy); db.AddInParameter(dbCommand, "@UpdatedOn", DbType.DateTime, PM_ALT_NOTIEntity.UpdatedOn); int result = db.ExecuteNonQuery(dbCommand); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.DataAccessDefaultPolicy); } return(PM_ALT_NOTIEntity as PM_ALT_NOTI); }
public AddColumnIfNotExistsOperation(string table, string name, Func <ColumnBuilder, ColumnModel> columnAction, object anonymousArguments) : base(anonymousArguments) { ArgumentValidator.CheckForEmptyArgument(table, nameof(table)); ArgumentValidator.CheckForEmptyArgument(name, nameof(name)); ArgumentValidator.CheckForNullArgument(columnAction, nameof(columnAction)); Table = table; Name = name; ColumnModel = columnAction(new ColumnBuilder()); ColumnModel.Name = name; }
public void UpdateSome(Plat_util_CodeDetail entity) { try { ArgumentValidator.CheckForNullArgument(entity, "Plat_util_CodeDetail Entity"); plat_util_CodeDetailDAO.Update(entity, false); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } }
public void Delete(Guid entityGuid) { try { ArgumentValidator.CheckForNullArgument(entityGuid, "Plat_util_CodeDetail Guid"); plat_util_CodeDetailDAO.Delete(entityGuid); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } }
public void UpdateSome(PM_ALT_EVENT_LOG entity) { try { ArgumentValidator.CheckForNullArgument(entity, "PM_ALT_EVENT_LOG Entity"); _PM_ALT_EVENT_LOGDAO.Update(entity, false); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } }
public void Delete(Guid entityGuid) { try { ArgumentValidator.CheckForNullArgument(entityGuid, "PM_ALT_EVENT_LOG Guid"); _PM_ALT_EVENT_LOGDAO.Delete(entityGuid); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } }
public void Update(PM_ALT_CONFIG_KEY entity) { try { ArgumentValidator.CheckForNullArgument(entity, "PM_ALT_CONFIG_KEY Entity"); pM_ALT_CONFIG_KEYDAO.Update(entity); } catch (Exception ex) { ExceptionPolicy.HandleException(ex, ExceptionPolicy.BusinessLogicDefaultPolicy); } }