#region
|
|
using System;
|
|
#endregion
|
|
namespace CSFrameworkV5.Business
|
{
|
/// <summary>
|
/// 生成单据的选择项目.
|
/// </summary>
|
public interface IDocGenerateItem
|
{
|
/// <summary>
|
/// 由其它单生成本单时需要用户输入来源单号
|
/// </summary>
|
bool IsDocNoRequired { get; }
|
|
/// <summary>
|
/// 标志是否生成成功
|
/// </summary>
|
bool IsSuccess { get; }
|
|
/// <summary>
|
/// 项目标题
|
/// </summary>
|
string ItemCaption { get; }
|
|
/// <summary>
|
/// 打开目标窗体对应的菜单名.
|
/// </summary>
|
string TargetFormMenuName { get; }
|
|
/// <summary>
|
/// 目标窗体名称
|
/// </summary>
|
string TargetFormName { get; }
|
|
/// <summary>
|
/// 目标窗体类型
|
/// </summary>
|
Type TargetFormType { get; }
|
|
/// <summary>
|
/// 自动生成数据
|
/// </summary>
|
/// <param name="targetBLL">目标单据的业务逻辑层</param>
|
/// <returns></returns>
|
bool Generate(bllBaseBusiness targetBLL);
|
|
/// <summary>
|
/// 检查来源单据的单号是否存在
|
/// </summary>
|
/// <param name="DocNo">单据号码</param>
|
/// <returns></returns>
|
bool IsDocNoExists(string DocNo);
|
|
/// <summary>
|
/// 设置来源单据的单号
|
/// </summary>
|
/// <param name="DocNo">业务单据号码</param>
|
void SetDocNo(string DocNo);
|
}
|
|
/// <summary>
|
/// 生成单据项目定义基类
|
/// </summary>
|
public class DocGenerateItemBase : IDocGenerateItem
|
{
|
protected string _DocNo;
|
protected bool _IsDocNoRequired;
|
protected bool _IsSuccess = false;
|
protected string _ItemCaption;
|
protected string _TargetFormMenuName;
|
protected string _TargetFormName;
|
protected Type _TargetFormType;
|
|
public DocGenerateItemBase()
|
{
|
}
|
|
public DocGenerateItemBase(string DocNo, bool IsDocNoRequired,
|
Type targetFormType, string targetFormName)
|
{
|
_DocNo = DocNo;
|
_IsDocNoRequired = IsDocNoRequired;
|
_TargetFormType = targetFormType;
|
_TargetFormName = targetFormName;
|
}
|
|
public virtual bool Generate(bllBaseBusiness targetBLL)
|
{
|
return false;
|
}
|
|
public virtual bool IsDocNoExists(string DocNo)
|
{
|
return false;
|
}
|
|
public bool IsDocNoRequired => _IsDocNoRequired;
|
|
public bool IsSuccess => _IsSuccess;
|
|
public string ItemCaption => _ItemCaption;
|
|
public void SetDocNo(string DocNo)
|
{
|
_DocNo = DocNo;
|
}
|
|
public string TargetFormMenuName => _TargetFormMenuName;
|
|
public string TargetFormName => _TargetFormName;
|
|
public Type TargetFormType => _TargetFormType;
|
}
|
}
|