コード例 #1
0
ファイル: LogContent.cs プロジェクト: shansheng/QDJJ
        /// <summary>
        /// 添加一次操作
        /// </summary>
        /// <param name="p_ModifyAttribute"></param>
        /// <returns></returns>
        public int Add(ModifyAttribute p_ModifyAttribute)
        {
            int ci = base.Add(p_ModifyAttribute);

            // m_Builder.AppendLine(string.Format("{0}.  {1}", ci, p_ModifyAttribute.ToLog()));
            return(ci);
        }
コード例 #2
0
        /// <summary>
        /// 根据ModfyAttrBute还原原始值
        /// </summary>
        /// <param name="p_Attr"></param>
        public static void ModifyObject(ModifyAttribute p_Attr)
        {
            Type         tp   = p_Attr.Source.GetType();
            PropertyInfo info = tp.GetProperty(p_Attr.PropertyName);

            if (info != null)
            {
                info.SetValue(p_Attr.Source, p_Attr.OriginalValue, null);
            }
        }
コード例 #3
0
 /// <summary>
 /// 指定属性需要记录对象时候调用
 /// </summary>
 /// <param name="value"></param>
 public override void ModifyAttribute(string PropertyName, object value, object OriginalValue)
 {
     //单位工程为空或者单位工程没有调用BeginModify方法不会发出请求操作
     if (this.Parent == null)
     {
         return;
     }
     if (this.Activitie == null)
     {
         return;
     }
     if (this.Activitie.ModfitingObject == null)
     {
         return;
     }
     if (this.Activitie.ModfitingObject.Current == null)
     {
         return;
     }
     if (this.Activitie.ModfitingObject.FiledName != string.Empty)
     {
         if (this.Activitie.ModfitingObject.FiledName != PropertyName)
         {
             return;
         }
     }
     if (this == this.Activitie.ModfitingObject.Current)
     {
         Type            tp          = this.GetType();
         MemberInfo      info        = tp.GetProperty(PropertyName);
         ModifyAttribute myAttribute = Attribute.GetCustomAttribute(info, typeof(ModifyAttribute)) as ModifyAttribute;
         if (myAttribute != null)
         {
             myAttribute.CurrentValue  = value;
             myAttribute.OriginalValue = OriginalValue;
             myAttribute.ObjectName    = this.MC;
             myAttribute.Source        = this;
             myAttribute.ActingOn      = "清单.子目.工料机.组成";
             //是否通知
             //正在编辑的对象和当前对象是一个实例则返回
             this.OnModelEdited(this, myAttribute);
         }
     }
 }