コード例 #1
0
 /// <summary>
 /// 导出事件
 /// </summary>
 /// <param name="sender">发送事件对象</param>
 /// <param name="e">发送者</param>
 void client_ExportEmployeeLeaveRecordReportsCompleted(object sender, ExportEmployeeLeaveRecordReportsCompletedEventArgs e)
 {
     loadbar.Stop();
     if (result == true)
     {
         if (e.Error == null)
         {
             if (e.Result != null)
             {
                 using (Stream stream = dialog.OpenFile())
                 {
                     stream.Write(e.Result, 0, e.Result.Length);
                 }
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("SUCCESSED"), Utility.GetResourceStr("导出成功"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
             }
             else
             {
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("没有数据可导出"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
             }
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
         }
     }
 }
コード例 #2
0
ファイル: EmployeeLeaveRecord.xaml.cs プロジェクト: JuRogn/OA
 /// <summary>
 /// 导出事件
 /// </summary>
 /// <param name="sender">发送事件对象</param>
 /// <param name="e">发送者</param>
 void client_ExportEmployeeLeaveRecordReportsCompleted(object sender, ExportEmployeeLeaveRecordReportsCompletedEventArgs e)
 {
     loadbar.Stop();
     if (result == true)
     {
         if (e.Error == null)
         {
             if (e.Result != null)
             {
                 using (Stream stream = dialog.OpenFile())
                 {
                     stream.Write(e.Result, 0, e.Result.Length);
                 }
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("SUCCESSED"), Utility.GetResourceStr("导出成功"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
             }
             else
             {
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("没有数据可导出"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
             }
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
         }
     }
 }