public static AttachmentInfo Create(AttachmentInfo model) { if (model.Id == 0) { model.Id = AttachmentManage.Add(model); } else { AttachmentManage.Edit(model); } return(model); }
public static AttachmentInfo Update(AttachmentInfo model) { if (model.Id > 0) { AttachmentManage.Update(model); } else { int id = AttachmentManage.Add(model); model.Id = id; } return(model); }