Ejemplo n.º 1
0
        /*
         * 팩스 1건을 전송합니다. (최대 전송파일 개수: 20개)
         * - https://docs.popbill.com/fax/dotnetcore/api#SendFAX
         */
        public IActionResult SendFAX()
        {
            // 발신번호
            string senderNum = "";

            // 발신자명
            string senderName = "발신자명";

            // 수신번호
            string receiverNum = "";

            // 수신자명
            string receiverName = "수신자명";

            // 팩스전송 파일경로, 전송파일 최대 20개
            List <string> filePath = new List <string>();

            filePath.Add("C:\\popbill.example.dotnetcore\\FaxExample\\wwwroot\\images\\tax_image.png");
            filePath.Add("C:\\popbill.example.dotnetcore\\FaxExample\\wwwroot\\images\\tax_image.png");

            // 팩스제목
            string title = "팩스 제목";

            // 예약전송일시(yyyyMMddHHmmss), null인 경우 즉시전송
            // ex) DateTime sndDT = new DateTime(20181230120000);
            DateTime?sndDT = null;

            // 광고팩스 전송여부 , true / false 중 택 1
            // └ true = 광고 , false = 일반
            // └ 미입력 시 기본값 false 처리
            bool adsYN = false;

            // 전송요청번호, 파트너가 전송요청에 대한 관리번호를 직접 할당하여 관리하는 경우 기재
            // 최대 36자리, 영문, 숫자, 언더바('_'), 하이픈('-')을 조합하여 사업자별로 중복되지 않도록 구성
            string requestNum = "";

            try
            {
                var receiptNum = _faxService.SendFAX(corpNum, senderNum, senderName, receiverNum, receiverName,
                                                     filePath, title, sndDT, adsYN, requestNum);
                return(View("ReceiptNum", receiptNum));
            }
            catch (PopbillException pe)
            {
                return(View("Exception", pe));
            }
        }
Ejemplo n.º 2
0
        //팩스 전송
        private void button1_Click(object sender, EventArgs e)
        {
            if (fileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string strFileName = fileDialog.FileName;


                try
                {
                    //SendFAX(사업자번호, 발신자번호, 수신팩스번호, 수신자명, 파일경로, 예약전송일시, 회원아이디)
                    String receiptNum = faxService.SendFAX(txtCorpNum.Text, "070-7510-6766", "02-6442-9700", "수신자 명칭", strFileName, getReserveDT(), txtUserId.Text);

                    MessageBox.Show("접수번호 : " + receiptNum);
                    txtReceiptNum.Text = receiptNum;
                }
                catch (PopbillException ex)
                {
                    MessageBox.Show(ex.code.ToString() + " | " + ex.Message);
                }
            }
        }