Microsoft MVP성태의 닷넷 이야기
글쓴 사람
다자래 (egasu15 at naver.com)
홈페이지
첨부 파일
 

프로그래스바를 구현해본것인데....3티어에서 프로시져의 진행률을 알려고합니다.
1,전체갯수
2,현재진행갯수
3,오류

  #region 프로그래스바

        public delegate void UpdateUIHandler();
        public Thread progressThread = null;
        bool m_Abort = false;
        public string strKey;
        public int index = 0;



        private void ubtnStart_Click(object sender, EventArgs e)
        {
            strKey = DateTime.Now.ToString("yyyyMMddHHmmss");
            m_State[0] = "C";
            SetDaliGate();
        }
        private void ubtnCancle_Click(object sender, EventArgs e)
        {
            m_State[0] = "D";

            SetDaliGate();
        }

        private void SetDaliGate()
        {
            string[] strTemp = lblSchDate.Text.Split(new string[] { "~" }, StringSplitOptions.None);

            //전체갯수와 초기화
            string[] sqlParams = new string[5];
            sqlParams[0] = strKey;
            sqlParams[1] = uneSch_Yy.Value.ToString();
            sqlParams[2] = ucbeSchAcc_Unit_CD.Value.ToString();
            sqlParams[3] = "%";
            sqlParams[4] = ucbeSchTax_Prd.Value.ToString();
           
            string strBizMethod = "ADMACCTTxblMana130Get_010";

            uteEdtTotCnt.Tag = Remoting.ExecuteScalar(this.m_BizComponent, strBizMethod, sqlParams,
                          JNU.Framework.Common.TransactionType.NotSupport, "CMMCOMM", false);
            {
                if (Convert.ToInt32(uteEdtTotCnt.Tag) >= 0)
                {
                    m_Abort = false;
                    SetCtrEnable(0, true);
                }
                else
                {
                    SetCtrEnable(0, false);
                }
                uteEdtTotCnt.Text = uteEdtTotCnt.Tag.ToString();


            }

            upbT1Edt.Maximum = int.Parse(string.IsNullOrEmpty(uteEdtTotCnt.Text) ? "0" : uteEdtTotCnt.Text);//전체갯수
            progressThread = new Thread(new ThreadStart(UpdateUI));
            progressThread.Start();

            //배치프로시져호출
            sqlParams = new string[14];
            sqlParams[0] = m_State[0];
            sqlParams[1] = uneSch_Yy.Value.ToString();
            sqlParams[2] = ucbeSchAcc_Unit_CD.Value.ToString();
            sqlParams[3] = string.IsNullOrEmpty(ucbeSchDiv_Org_CD.Value.ToString()) ? "%" : ucbeSchDiv_Org_CD.Value.ToString();
            sqlParams[4] = "%";
            sqlParams[5] = "%";
            sqlParams[6] = uosSchOrg_CD.CheckedItem.DataValue.ToString();
            sqlParams[7] = "%";
            sqlParams[8] = strTemp[0].Replace("-", "");;
            sqlParams[9] = strTemp[1].Replace("-", "");;
            sqlParams[10] = m_User_Id;
            sqlParams[11] = m_Ip_Address;
            sqlParams[12] = m_User_Id;
            sqlParams[13] = m_Ip_Address;

            strBizMethod = "ADMACCTTxblMana010Bat_010";

            if ((int)Remoting.Execute(this.m_BizComponent, strBizMethod, sqlParams,
                          JNU.Framework.Common.TransactionType.NotSupport, "CMMCOMM", false) == 0)
            {

                if (index > 0)
                {
                    m_Abort = true;
                }
                upbT1Edt.Value = upbT1Edt.Minimum;
            }
        }

        public void DoProgress()
        {
            upbT1Edt.Invoke(new UpdateUIHandler(UpdateUI));
        }

        private void UpdateUI()
        {
            try
            {
                for (int i = 0; i <= upbT1Edt.Maximum; i++)
                {
                    index = i;
                    if (m_Abort)
                    {
                        m_Abort = false;
                        break;
                    }

                       Application.DoEvents();
                        upbT1Edt.Value = i;
                       
                   uteEdtProCnt.Text = i.ToString();

                    

                  Thread.Sleep(10);

                }
                Application.DoEvents();
            }
            finally
            {
                Thread.Sleep(100);
                upbT1Edt.Value = upbT1Edt.Minimum;
                uteEdtErrCnt.Text = Convert.ToString(int.Parse(uteEdtTotCnt.Text) - int.Parse(uteEdtProCnt.Text));
            }

        }


        #endregion








[최초 등록일: ]
[최종 수정일: 7/15/2008]


비밀번호

댓글 작성자
 



2008-07-20 10시27분
죄송하지만,,, 위의 코드를 보는 저도 막막한데요. ^^
저장 프로시저의 진행율을 알고 싶다면, 해당 저장 프로시저 안에서 그에 대한 리포트를 외부로 (3-tier 라면 난감하군요.) 전달해 줘야 할 텐데, 그에 대한 구현이 쉽지는 않으실 텐데요.

이런 경우에는, 정확한 %를 보여주기 보다는, 작업이 진행중이라는 표현을 하시는 것이 더 좋지 않을까요?
아니면, 클라이언트 측에서 트랜잭션을 담당하고 SQL 쿼리를 잘게 실행시키면서 진행율을 보여주는 식을 택하거나.
kevin25

... 61  62  63  64  65  66  [67]  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
886김재영6/16/201011163스레드 선언시 (Parameterized/)ThreadStart에 정의되는 메소드의 위치에 질문이 있습니다. [3]
885장근배6/13/201018321Win32Exception 창 핸들 에러 [1]
883채동민6/10/201010783비동기 DB 쿼리관련 질문
884정성태6/10/201012081    답변글 [답변]: 비동기 DB 쿼리관련 질문
881최준영5/24/201011728load되지않은 아이템 load하는 방법? [1]
880임상일5/10/201013635VS2010 TestManager를 통한 UI Test 관련 질문입니다. [2]파일 다운로드1
879정용훈5/3/201014650wcf 인증 문제 [2]
878채동민4/20/201013796WCF에서 maxItemsInObjectGraph 오류 관련 질문드립니다. [2]
872날쌘돌이4/8/201016670Windows7 에서 IIS에서 폼인증 으로 디버깅.. [1]파일 다운로드1
871영초4/7/201011920실버라이트로 스캐너 구동 프로그램이 가능할까요? [1]
869김재영4/6/201010710이미 실행된 어셈블리 컨트롤 권한을 다른 어셈블리에서 가져올 수 있습니까? [2]
868Lime3/5/201014531WCF 에서의 DataTable 사용 [2]
867Dani...2/18/201014466Question - HTTP 401.3 on DELETE, PUT verbs [6]파일 다운로드1
865박근대2/16/201011293WCF 오류 문의. [1]
863날쌘돌이1/31/201014059ActiveX Cab에서 닷넷 dll 등록 [1]
862장근배1/28/201011326AppPolId를 알 수 있는 방법이 있는지요? [1]
864장근배2/1/201011178    답변글 [답변]: AppPolId를 알 수 있는 방법이 있는지요?
858생초보1/26/201011461안녕하세요.. 파일 생성 처리 문제로 .... [2]
857꼭지1/22/201016460How to support Basic + Windows authentication mode in WCF(RESTful service) [4]파일 다운로드2
856질의자1/13/201015077vcredist_x86 배포 관련 여쭙습니다. [1]
855임동찬1/13/201012945이벤트 핸들러와 쓰레드의 관계 2 [4]파일 다운로드2
854임동찬1/12/201012985이벤트 핸들러와 쓰레드의 관계 [1]
853장근배1/12/201012986압축 프로그램,, [1]
852임동찬1/6/201010760base.OnStart(agrs) [1]
851한귀순1/6/201016220oracle & transaction 질문 [5]
850박한주12/31/200913360COM과 C#간 권한 문제에 관해 여쭤봅니다. [5]
... 61  62  63  64  65  66  [67]  68  69  70  71  72  73  74  75  ...