2022-01-19 15:49:29 +08:00
|
|
|
|
using System;
|
|
|
|
|
using OpenAuth.Repository;
|
|
|
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
|
using OpenAuth.Repository.Interface;
|
2025-04-02 23:31:38 +08:00
|
|
|
|
using Infrastructure;
|
2022-01-19 15:49:29 +08:00
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App
|
|
|
|
|
{
|
|
|
|
|
public class FormFactory
|
|
|
|
|
{
|
|
|
|
|
public static IForm CreateForm(Form form, IUnitWork<OpenAuthDBContext> unitWork)
|
|
|
|
|
{
|
2025-04-02 23:31:38 +08:00
|
|
|
|
if (form.FrmType == Define.FORM_TYPE_DYNAMIC)
|
2022-01-19 15:49:29 +08:00
|
|
|
|
{
|
|
|
|
|
return new LeipiForm(unitWork);
|
2025-04-02 23:31:38 +08:00
|
|
|
|
}else if (form.FrmType == Define.FORM_TYPE_DEVELOP)
|
2022-01-19 15:49:29 +08:00
|
|
|
|
{
|
|
|
|
|
throw new Exception("自定义表单不需要创建数据库表");
|
|
|
|
|
}
|
2025-04-02 23:31:38 +08:00
|
|
|
|
else
|
2022-01-19 15:49:29 +08:00
|
|
|
|
{
|
|
|
|
|
return new DragForm(unitWork);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|