using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperMap.RealEstate.WorkFlow.Instance;
namespace SuperMap.RealEstate.MemberShip.Plugins
{
public class MemberProinst: IWorkFlowProInstDataAction, IWorkFlowActInstDataAction
{
//在线充值
ProInst_700100 _ProInst_700100 = null;
///
public string ErrorString
{
get;
set;
}
///
/// 办结
///
///
///
public bool EndProcess(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = true;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 在线充值审批
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.EndProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
///
/// 驳回
///
///
///
public bool FallBackRunning(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
throw new NotImplementedException();
}
///
/// 入库
///
///
///
public bool PutInStorage(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = true;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
PutInStorageCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 在线充值审批
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.PutInStorage(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
///
/// 流程删除
///
///
///
public bool DeleteProcess(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
bool Flag = false;
string _ErrorString = "";
Running.Business.MEMBERPROINST _MEMBERPROINST = GetPropertyProinst(WorkFlowProInst);
DeleteCommonInfo(_MEMBERPROINST);
switch (WorkFlowProInst.Operation_Type_BaseValue)
{
case 700100:
#region 在线充值审批
Flag = false;
_ProInst_700100 = new ProInst_700100(_MEMBERPROINST);
Flag = _ProInst_700100.DeleteProcess(WorkFlowProInst, out _ErrorString);
ErrorString += _ErrorString;
break;
#endregion
default:
throw new Exception("Plugins尚未配置");
}
return Flag;
}
///
public void DeleteCommonInfo(Running.Business.MEMBERPROINST _MEMBERPROINST)
{
//删除审批意见信息
foreach (Running.Business.APPROVED _APPROVED in _MEMBERPROINST.ApprovedCollection)
{
_APPROVED.Delete();
}
//删除流程意见信息
foreach (Running.Business.ACTINSTOPINION _ACTINSTOPINION in _MEMBERPROINST.ActinstOpinionCollection)
{
_ACTINSTOPINION.Delete();
}
}
///
public void PutInStorageCommonInfo(Running.Business.MEMBERPROINST _MEMBERPROINST)
{
Storage.Business.APPROVED StorageApproved = null;
//审批意见信息
foreach (Running.Business.APPROVED _Approved in _MEMBERPROINST.ApprovedCollection)
{
StorageApproved = new Storage.Business.APPROVED(_MEMBERPROINST.Transaction);
StorageApproved.APPROVED_ID = _Approved.APPROVED_ID;
if (StorageApproved.Select())
{
StorageApproved.Delete();
StorageApproved.ResetProperty();
}
StorageApproved.CopyFrom(_Approved);
StorageApproved.Insert();
}
//流程意见信息
foreach (Running.Business.ACTINSTOPINION _ActinstOpinion in _MEMBERPROINST.ActinstOpinionCollection)
{
Storage.Business.ACTINSTOPINION StorageActinstOpinion = new Storage.Business.ACTINSTOPINION(_MEMBERPROINST.Transaction);
StorageActinstOpinion.ACTINSTOPINION_ID = _ActinstOpinion.ACTINSTOPINION_ID;
if (StorageActinstOpinion.Select())
{
StorageActinstOpinion.Delete();
StorageActinstOpinion.ResetProperty();
}
StorageActinstOpinion.CopyFrom(_ActinstOpinion);
StorageActinstOpinion.Insert();
}
}
///
/// 获取当前流程信息
///
///
///
public Running.Business.MEMBERPROINST GetPropertyProinst(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst WorkFlowProInst)
{
Running.Business.MEMBERPROINST _PropertyProinst = new Running.Business.MEMBERPROINST(WorkFlowProInst.Transaction);
_PropertyProinst.AddSearchParameter("proinst_id", WorkFlowProInst.ProInst_ID);
if (_PropertyProinst.Search())
return _PropertyProinst;
else
{
throw new Exception("无法获取ProInst实例对象!");
}
}
#region 流转
///
public bool OverRuled(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
///
public bool OverRuling(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
///
public bool Transfered(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
///
public bool Transferring(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
///
public bool TurnOvered(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
///
public bool TurnOvering(SuperMap.RealEstate.WorkFlow.Instance.Business.ProInst ProInst)
{
return true;
}
#endregion
}
}