Esempio n. 1
0
 public static AttachmentInfo Create(AttachmentInfo model)
 {
     if (model.Id == 0)
     {
         model.Id = AttachmentManage.Add(model);
     }
     else
     {
         AttachmentManage.Edit(model);
     }
     return(model);
 }
Esempio n. 2
0
 public static AttachmentInfo Update(AttachmentInfo model)
 {
     if (model.Id > 0)
     {
         AttachmentManage.Update(model);
     }
     else
     {
         int id = AttachmentManage.Add(model);
         model.Id = id;
     }
     return(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 添加或编辑
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static AttachmentInfo Create(AttachmentInfo model)
 {
     if (model.Id == 0)
     {
         int id = AttachmentManage.Insert(model);
         model.Id = id;
     }
     else
     {
         AttachmentManage.Update(model);
     }
     return(model);
 }
Esempio n. 4
0
 private void SaveToDB()
 {
     if (allMail.Count <= 0)
     {
         return;
     }
     try
     {
         IContentManage    MailContentMng = new ContentManage();
         IAttachmentManage MailAttachMng  = new AttachmentManage();
         int mailId;
         int mailCount = hmail.MailCount - currMailCount;
         allMail.ToList().ForEach(s =>
         {
             mailId = MailMng.CreateMail(HMConvert.ConvertMailEntity.ConvertToDbMailEntity((int)AppMain.currUser.Id, s));
             HMConvert.ConvertMailEntity.ConvertToDbContentEntity(mailId, s).ToList().ForEach(v =>
             {
                 MailContentMng.CreateContent(v);
             });
             HMConvert.ConvertMailEntity.ConvertToDbAttachEntity(mailId, s).ToList().ForEach(n =>
             {
                 MailAttachMng.CreateAttactment(n);
             });
             this.Invoke(new MethodInvoker(() =>
             {
                 this.progressBar1.Value--;
                 TestLaber.Text = mailCount.ToString();
                 mailCount--;
             }));
         });
     }
     catch (Exception e)
     {
         AppLog.SysLog(e.ToString());
     }
 }
Esempio n. 5
0
 public static IPageOfList <AttachmentInfo> List(SearchSetting setting)
 {
     return(AttachmentManage.List(setting));
 }
Esempio n. 6
0
 public static AttachmentInfo Get(int id)
 {
     return(AttachmentManage.Get(id));
 }
Esempio n. 7
0
 public static void UpdateDownloadCount(int id)
 {
     AttachmentManage.UpdateDownloadCount(id);
 }
Esempio n. 8
0
 /// <summary>
 /// 插入下载日志
 /// </summary>
 /// <param name="model"></param>
 public static void InsertLog(AttachmentDownloadLogInfo model)
 {
     AttachmentManage.InsertLog(model);
 }
Esempio n. 9
0
 /// <summary>
 /// 列表
 /// </summary>
 /// <param name="setting"></param>
 /// <returns></returns>
 public static IPageOfList <AttachmentDownloadLogInfo> ListLog(int attachId, SearchSetting setting)
 {
     return(AttachmentManage.ListLog(attachId, setting));
 }
Esempio n. 10
0
 /// <summary>
 /// 根据GUID获得详细信息
 /// </summary>
 /// <param name="guid"></param>
 /// <returns></returns>
 public static AttachmentInfo GetByGUID(string guid)
 {
     return(AttachmentManage.GetByGUID(guid));
 }
Esempio n. 11
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static int Delete(int id)
 {
     return(AttachmentManage.Delete(id));
 }