Beispiel #1
0
 public void UpdateAttachment(S_Attachment attachment)
 {
     if (attachment.IsNewModel)
     {
         throw new Formula.Exceptions.BusinessException("附件对象新建对象,无法调用更新方法");
     }
     attachment.Save();
     var attch = this.Attachments.FirstOrDefault(d => d.ID == attachment.ID);
 }
Beispiel #2
0
 public void AddAttachment(S_Attachment attachment)
 {
     if (!attachment.IsNewModel)
     {
         throw new Formula.Exceptions.BusinessException("附件对象不是新建对象,无法调用添加方法");
     }
     attachment.NodeID         = this.ID;
     attachment.CurrentVersion = "True";
     attachment.Version        = this.getMaxAttachVersion();
     attachment.Save();
     this.Attachments.Add(attachment);
 }
Beispiel #3
0
 public void AddAttachment(S_Attachment attachment)
 {
     if (!attachment.IsNewModel)
     {
         throw new Formula.Exceptions.BusinessException("附件对象不是新建对象,无法调用添加方法");
     }
     if (this.IsNewModel)
     {
         this.Attachments.Add(attachment);
         attachment.Version = 0;
     }
     else
     {
         this.InstanceDB.ExecuteNonQuery(" update S_Attachment set CurrentVersion='False' where FileID='" + this.ID + "' ");
         attachment.FileID         = this.ID;
         attachment.NodeID         = this.NodeID;
         attachment.CurrentVersion = "True";
         attachment.Version        = this.getMaxAttachVersion();
         attachment.Save();
         this.Attachments.Add(attachment);
     }
 }