#LogWatch 实现值更新事件赋值过程记录日志监控
clr.AddReference('System')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS import *
from Kingdee.BOS.Log import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
#from Kingdee.BOS.Core.Metadata.EntityElement import *
from System import *
def AfterCreateNewData(e):
if this.Context.ServiceType == WebType.WebService:
Logger.Info("系统集成", "【"+this.View.BillBusinessInfo.GetForm().Name.ToString()+"】");
def DataChanged(e):
newValueString = "(空)";
oldValueString = "(空)";
if not e.NewValue is None:
newValueString = Convert.ToString(e.NewValue);
if not e.OldValue is None:
oldValueString = Convert.ToString(e.OldValue);
if this.Context.ServiceType == WebType.WebService:
# Logger.Info("系统集成 DataChanged ", "["+e.Field.Key+"]-"+e.Field.Name.ToString()+ ":{OldValue->NewValue}"+oldValueString+"->"+newValueString);
Logger.Info("系统集成 DataChanged ", "["+e.Field.Key+"]-"+e.Field.Name.ToString()+ ":"+oldValueString+"->"+newValueString);