Exemplo n.º 1
0
        UploadData(string fileName, Stream rawData, string testingNo, string examPlaceCode, string userId, DTO.UserProfile userProfile)
        {
            var res = new DTO.ResponseService <DTO.SummaryReceiveApplicant>();

            if (rawData == null)
            {
                res.ErrorMsg = Resources.errorApplicantBiz_001;
                return(res);
            }
            try
            {
                Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("th-TH");
                //DTO.UploadData data = ReadFileUpload(rawData);
                //เปลี่ยนสไตล์ของวันที่เป็นแบบไทย เพื่อแสดงค่าที่เป็นปี พ.ศ.
                DTO.RegistrationType memberType = (DTO.RegistrationType)userProfile.MemberType;
                // FileManagement.FileServiceClient file = new FileManagement.FileServiceClient();
                String filePath = UploadFileApplicantToTemp(rawData);


                InsertAndCheckApplicantGroupUploadRequest request = new InsertAndCheckApplicantGroupUploadRequest()
                {
                    FilePath         = filePath,
                    FileName         = fileName,
                    RegistrationType = memberType,
                    TestingNo        = testingNo,
                    ExamPlaceCode    = examPlaceCode,
                    UserProfile      = userProfile
                };
                res = svc.InsertAndCheckApplicantGroupUpload(request);
                // res = file.InsertAndCheckApplicantGroupUpload(data, fileName, memberType, testingNo, examPlaceCode, userProfile);
            }
            catch (Exception ex)
            {
                res.ErrorMsg = "กรุณาติดต่อผู้ดูแลระบบ";
            }

            return(res);
        }