public virtual AspdnsfSysLog UpdateAspdnsfSysLog(AspdnsfSysLog entity) { if (entity.IsTransient()) { return(entity); } AspdnsfSysLog other = GetAspdnsfSysLog(entity.SysLogId); if (entity.Equals(other)) { return(entity); } string sql = @"Update aspdnsf_SysLog set [SysLogGUID]=@SysLogGUID , [Message]=@Message , [Details]=@Details , [Type]=@Type , [Severity]=@Severity , [CreatedOn]=@CreatedOn where SysLogID=@SysLogID" ; SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@SysLogID", entity.SysLogId) , new SqlParameter("@SysLogGUID", entity.SysLogGuid) , new SqlParameter("@Message", entity.Message) , new SqlParameter("@Details", entity.Details ?? (object)DBNull.Value) , new SqlParameter("@Type", entity.Type) , new SqlParameter("@Severity", entity.Severity) , new SqlParameter("@CreatedOn", entity.CreatedOn) }; SqlHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql, parameterArray); return(GetAspdnsfSysLog(entity.SysLogId)); }
public virtual AspdnsfSysLog AspdnsfSysLogFromDataRow(DataRow dr) { if (dr == null) { return(null); } AspdnsfSysLog entity = new AspdnsfSysLog(); entity.SysLogId = (System.Int32)dr["SysLogID"]; entity.SysLogGuid = (System.Guid)dr["SysLogGUID"]; entity.Message = dr["Message"].ToString(); entity.Details = dr["Details"].ToString(); entity.Type = dr["Type"].ToString(); entity.Severity = dr["Severity"].ToString(); entity.CreatedOn = (System.DateTime)dr["CreatedOn"]; return(entity); }
public virtual AspdnsfSysLog InsertAspdnsfSysLog(AspdnsfSysLog entity) { AspdnsfSysLog other = new AspdnsfSysLog(); other = entity; if (entity.IsTransient()) { string sql = @"Insert into aspdnsf_SysLog ( [SysLogGUID] ,[Message] ,[Details] ,[Type] ,[Severity] ,[CreatedOn] ) Values ( @SysLogGUID , @Message , @Details , @Type , @Severity , @CreatedOn ); Select scope_identity()" ; SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@SysLogID", entity.SysLogId) , new SqlParameter("@SysLogGUID", entity.SysLogGuid) , new SqlParameter("@Message", entity.Message) , new SqlParameter("@Details", entity.Details ?? (object)DBNull.Value) , new SqlParameter("@Type", entity.Type) , new SqlParameter("@Severity", entity.Severity) , new SqlParameter("@CreatedOn", entity.CreatedOn) }; var identity = SqlHelper.ExecuteScalar(this.ConnectionString, CommandType.Text, sql, parameterArray); if (identity == DBNull.Value) { throw new DataException("Identity column was null as a result of the insert operation."); } return(GetAspdnsfSysLog(Convert.ToInt32(identity))); } return(entity); }
public AspdnsfSysLog InsertAspdnsfSysLog(AspdnsfSysLog entity) { return(_iAspdnsfSysLogRepository.InsertAspdnsfSysLog(entity)); }
public AspdnsfSysLog UpdateAspdnsfSysLog(AspdnsfSysLog entity) { return(_iAspdnsfSysLogRepository.UpdateAspdnsfSysLog(entity)); }
public virtual AspdnsfSysLog DeleteAspdnsfSysLog(AspdnsfSysLog entity) { this.DeleteAspdnsfSysLog(entity.SysLogId); return(entity); }