Exemplo n.º 1
0
 /// <summary>
 /// 删除附件
 /// </summary>
 /// <param name="applyAttachmentId"></param>
 /// <returns></returns>
 public static bool DeleteApplyAttachmentView(Guid applyAttachmentId, string operators)
 {
     using (DataAccess.DbOperator commad = Factory.CreateCommand())
     {
         //记录操作日志
         ApplyAttachmentView apply       = Service.ApplyformQueryService.QueryApplyAttachmentView(applyAttachmentId);
         bool isSuccess                  = false;
         IApplyformRepository repository = Factory.CreateApplyformRepository(commad);
         try
         {
             repository.DeleteApplyAttachmentView(applyAttachmentId);
             isSuccess = true;
         }
         catch (Exception ex)
         {
             LogService.SaveExceptionLog(ex);
             isSuccess = false;
         }
         if (isSuccess && apply != null)
         {
             saveLog(OperationType.Delete, string.Format("删除:退票附件。申请单号:{0},附件Id:{1},源文件相对路径:{2},时间:{3},操作员:{4}",
                                                         apply.ApplyformId, apply.Id, apply.FilePath, apply.Time, operators),
                     OperatorRole.Platform, apply.ApplyformId.ToString(), operators);
         }
         return(isSuccess);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加附件
 /// </summary>
 /// <param name="applyAttachmentViews"></param>
 /// <returns></returns>
 public static bool AddApplyAttachmentView(List <ApplyAttachmentView> applyAttachmentViews, string operators)
 {
     using (DataAccess.DbOperator commad = Factory.CreateCommand())
     {
         bool isSuccess = false;
         IApplyformRepository repository = Factory.CreateApplyformRepository(commad);
         try
         {
             repository.AddApplyAttachmentView(applyAttachmentViews);
             isSuccess = true;
         }
         catch (Exception ex)
         {
             LogService.SaveExceptionLog(ex);
             isSuccess = false;
         }
         //记录操作日志
         ApplyAttachmentView apply = applyAttachmentViews.FirstOrDefault();
         if (isSuccess && apply != null)
         {
             saveLog(OperationType.Insert, string.Format("添加:退票附件。申请单号:{0},附件Id:{1},源文件相对路径:{2},时间:{3},操作员:{4}",
                                                         apply.ApplyformId, apply.Id, apply.FilePath, apply.Time, operators),
                     OperatorRole.Platform, apply.ApplyformId.ToString(), operators);
         }
         return(isSuccess);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 查询申请单附件信息
 /// </summary>
 /// <param name="applyAttachmentId">申请单Id</param>
 /// <returns></returns>
 public static ApplyAttachmentView QueryApplyAttachmentView(Guid applyAttachmentId)
 {
     using (DataAccess.DbOperator commad = Factory.CreateCommand())
     {
         IApplyformRepository repository = Factory.CreateApplyformRepository(commad);
         return(repository.QueryApplyAttachmentView(applyAttachmentId));
     }
 }