using System;
using System.Collections;
using BP.DA;
using System.Reflection;
using BP.En;
using BP.Web;
using BP.Difference;
namespace BP.En
{
public enum MsgShowType
{
///
/// 本界面
///
SelfAlert,
///
/// 提示框
///
SelfMsgWindows,
///
/// 新窗口
///
Blank
}
///
/// Method 的摘要说明
///
abstract public class Method
{
///
/// 信息显示类型
///
public MsgShowType HisMsgShowType = MsgShowType.Blank;
#region Http
public string Request(string key)
{
return HttpContextHelper.RequestParams(key);
}
///
/// 获取MyPK
///
public string RequestRefMyPK
{
get
{
string s = Request("RefMyPK");
if (s == null)
s = Request("RefPK");
return s;
}
}
public string RequestRefNo
{
get
{
return Request("RefNo");
}
}
public int RequestRefOID
{
get
{
return int.Parse(Request("RefOID"));
}
}
#endregion Http
#region ROW
///
/// 获取Key值
///
/// 键
/// 结果
public object GetValByKey(string key)
{
return this.Row.GetValByKey(key);
}
///
/// 获取str值
///
/// 键
/// 结果
public string GetValStrByKey(string key)
{
return this.GetValByKey(key).ToString();
}
///
/// 获取int值
///
/// 键
/// 结果
public int GetValIntByKey(string key)
{
return (int)this.GetValByKey(key);
}
///
/// 获取decimal值
///
/// 键
/// 结果
public decimal GetValDecimalByKey(string key)
{
return (decimal)this.GetValByKey(key);
}
///
/// 获取bool值
///
/// 键
/// 结果
public bool GetValBoolByKey(string key)
{
if (this.GetValIntByKey(key) == 1)
return true;
return false;
}
public void SetValByKey(string attrKey, int val)
{
this.Row.SetValByKey(attrKey, val);
}
public void SetValByKey(string attrKey, Int64 val)
{
this.Row.SetValByKey(attrKey, val);
}
public void SetValByKey(string attrKey, float val)
{
this.Row.SetValByKey(attrKey, val);
}
public void SetValByKey(string attrKey, decimal val)
{
this.Row.SetValByKey(attrKey, val);
}
public void SetValByKey(string attrKey, object val)
{
this.Row.SetValByKey(attrKey, val);
}
///
/// 实体的 map 信息。
///
//public abstract void EnMap();
private Row _row = null;
public Row Row
{
get
{
if (this.HisAttrs == null)
return null;
if (this._row == null)
{
this._row = new Row();
this._row.LoadAttrs(this.HisAttrs);
}
return this._row;
}
set
{
this._row = value;
}
}
#endregion
///
/// 方法基类
///
public Method()
{
}
#region 属性
///
/// 参数
///
private Attrs _HisAttrs = null;
public Attrs HisAttrs
{
get
{
if (_HisAttrs == null)
_HisAttrs = new Attrs();
return _HisAttrs;
}
}
///
/// 标题
///
public string Title = null;
public string Help = null;
public string GroupName = "基本方法";
///
/// 操作前提示信息
///
public string Warning = null;
///
/// 图标
///
public string Icon = null;
public string GetIcon(string path)
{
if (this.Icon == null)
{
return "";
}
else
{
return Icon;
//return "";
}
}
///
/// 提示信息
///
public string ToolTip = null;
///
/// 目标
///
public string Target = "OpenWin";
///
/// 高度
///
public int Height = 600;
///
/// 宽度
///
public int Width = 800;
///
/// 执行
///
///
///
public abstract object Do();
public abstract void Init();
///
/// 权限管理
///
public abstract bool IsCanDo
{
get;
}
///
/// 是否显示在功能列表里
///
public bool IsVisable = true;
#endregion
}
}