更改了拖入的DLL显示名称

尝试添加了web自动化测试(基于Selenium)
This commit is contained in:
fengjiayi
2024-08-05 19:43:57 +08:00
parent 989a2c0800
commit 5b15871f65
37 changed files with 700 additions and 80 deletions

View File

@@ -114,7 +114,9 @@ namespace Serein.DbSql
{
// Console.WriteLine($"主数据库无法连接IP:{IP},端口:{Port}");
DBSync.SetIsNeedSyncData(true); // 网络不可达
return null;
}
// 检查是否需要同步数据
@@ -134,7 +136,9 @@ namespace Serein.DbSql
catch // (Exception ex)
{
// Console.WriteLine($"发生异常:{ex.Message}");
return null;
}
}
@@ -168,8 +172,14 @@ namespace Serein.DbSql
}
public static string GetDescription(DBSyncExType value)
{
FieldInfo field = value.GetType().GetField(value.ToString());
DescriptionAttribute attribute = (DescriptionAttribute)field.GetCustomAttribute(typeof(DescriptionAttribute));
return attribute == null ? value.ToString() : attribute.Description;
}
@@ -184,15 +194,21 @@ namespace Serein.DbSql
/// <summary>
/// 主数据库配置
/// </summary>
private static ConnectionConfig PrimaryConfig { get; set; }
/// <summary>
/// 从数据库配置
/// </summary>
private static ConnectionConfig SecondaryConfig { get; set; }
/// <summary>
/// 主数据库IP
/// </summary>
private static string Host { get; set; }
/// <summary>
/// 主数据库端口
/// </summary>
@@ -200,8 +216,12 @@ namespace Serein.DbSql
/// <summary>
/// 同步数据事件(远程数据库,本地数据库,是否执行成功)
/// </summary>
private static Func<SqlSugarClient, SqlSugarClient, bool> SyncDataEvent { get; set; }
private static Action<bool> StateChangeEvent { get; set; }
/// <summary>
/// 数据库设置锁
/// </summary>
@@ -467,8 +487,14 @@ namespace Serein.DbSql
public static string GetDescription(DBSyncStart value)
{
FieldInfo field = value.GetType().GetField(value.ToString());
DescriptionAttribute attribute = (DescriptionAttribute)field.GetCustomAttribute(typeof(DescriptionAttribute));
return attribute == null ? value.ToString() : attribute.Description;
}
@@ -565,11 +591,15 @@ namespace Serein.DbSql
};
break;
default:
config = null;
break;
}
return config;
}
}

View File

@@ -398,7 +398,9 @@ namespace Serein.Helper
isHaveErr = true;
ErrMsg = ex.Message;
return null;
}
}
@@ -503,7 +505,9 @@ namespace Serein.Helper
}
public virtual string GetPageList(Pagination pagination, Expression<Func<TEntity, bool>> where = null)
{
//DatabaseSync.StartcaControls();
return new
@@ -523,7 +527,9 @@ namespace Serein.Helper
}
public virtual List<TEntity> GetTop(int Top, Expression<Func<TEntity, object>> expression, OrderByType _OrderByType = OrderByType.Asc, Expression<Func<TEntity, bool>> where = null, string selstr = "*")
{
return SyncRead(db => db.Queryable<TEntity>().Select(selstr).WhereIF(where != null, where)
.Take(Top)
@@ -539,14 +545,18 @@ namespace Serein.Helper
/// <param name="_OrderByType"></param>
/// <param name="where"></param>
/// <returns></returns>
public virtual TEntity GetFirst(Expression<Func<TEntity, object>> OrderExpression, OrderByType _OrderByType = OrderByType.Asc, Expression<Func<TEntity, bool>> where = null)
{
return SyncRead(db => db.Queryable<TEntity>().Filter(filterName, isDisabledGobalFilter: true).WhereIF(where != null, where)
.OrderBy(OrderExpression, _OrderByType)
.First());
}
public virtual List<TEntity> GetList(Pagination pagination, Expression<Func<TEntity, bool>> where = null)
{
int totalNumber = 0;
List<TEntity> result = SyncRead(db => db.Queryable<TEntity>().WhereIF(where != null, where).OrderBy(pagination.sidx + " " + pagination.sord)
@@ -557,7 +567,9 @@ namespace Serein.Helper
}
public virtual List<TEntity> GetList(Expression<Func<TEntity, bool>> where = null)
{
return SyncRead(db => db.Queryable<TEntity>().WhereIF(where != null, where).Filter(filterName, isDisabledGobalFilter: true)
.ToList());
@@ -569,7 +581,11 @@ namespace Serein.Helper
}
public virtual DataTable GetDataTable(Expression<Func<TEntity, bool>> where = null, Pagination pagination = null)
{
if (pagination != null)
{
@@ -598,7 +614,9 @@ namespace Serein.Helper
return 0;
});
filterName = null;
}
@@ -818,13 +836,17 @@ namespace Serein.Helper
/// <summary>
/// /排序列
/// </summary>
public string sidx { get; set; }
/// <summary>
/// 排序类型
/// </summary>
public string sord { get; set; }
/// <summary>
/// 总记录数
/// </summary>