コード例 #1
0
        private void ImportBalance()
        {
            string strMsg = string.Empty;

            try
            {
                System.IO.Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                byte[] Buffer = new byte[Stream.Length];
                Stream.Read(Buffer, 0, (int)Stream.Length);

                Stream.Dispose();
                Stream.Close();

                SMT.FBAnalysis.ClientServices.DailyManagementWS.UploadFileModel UploadFile = new SMT.FBAnalysis.ClientServices.DailyManagementWS.UploadFileModel();
                UploadFile.FileName = OpenFileDialog.File.Name;
                UploadFile.File     = Buffer;

                client.ImportAttendMonthlyBalanceFromCSVAsync(UploadFile, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strMsg);

                strMsg = string.Empty;
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }
コード例 #2
0
ファイル: ImportChargeApply.xaml.cs プロジェクト: JuRogn/OA
        private void ImportBalance()
        {
            string strMsg = string.Empty;
            try
            {
                System.IO.Stream Stream = (System.IO.Stream)OpenFileDialog.File.OpenRead();

                byte[] Buffer = new byte[Stream.Length];
                Stream.Read(Buffer, 0, (int)Stream.Length);

                Stream.Dispose();
                Stream.Close();

                SMT.FBAnalysis.ClientServices.DailyManagementWS.UploadFileModel UploadFile = new SMT.FBAnalysis.ClientServices.DailyManagementWS.UploadFileModel();
                UploadFile.FileName = OpenFileDialog.File.Name;
                UploadFile.File = Buffer;

                client.ImportAttendMonthlyBalanceFromCSVAsync(UploadFile, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strMsg);

                strMsg = string.Empty;
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message.ToString()));
            }
        }