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

... 16  17  18  19  20  21  22  23  24  [25]  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
5290베도빈2/15/20207537직접 제작한 사용자 정의 콘트롤 DLL, 실행파일에 포함시켜 배포할 수 있을까요? [1]
5288김성배2/14/20207873c# 참조추가 기능에서 DirectX 참조가 보이지 않아요.. DircetX 11 은 설치 되어 있습니다. [1]
5287C# 초...2/14/20206994프로그램 실행 질문 드립니다. [4]파일 다운로드1
5286gongs2/3/202014489윈도우 배율 및 레이아웃에 대한 질문입니다. [3]
5285강성욱1/27/20208149작업관리자에 표시되는 스레드 개수와 프로그램 내 스레드 개수 일치 [1]
5284이상준1/15/202013898출력창에 '스레드가 종료되었습니다' 문구 문의 [2]파일 다운로드1
5282봉봉이 1/13/202010617소켓 비동기 ReceiveTimeOut 구현 [9]파일 다운로드1
5281봉봉이 1/13/20208575소켓 비동기 ReceiveTimeOut 구현 [2]
5280sdd1/8/20207228데이터 저장, 배치파일 관련하여 질문드립니다. [4]
5279김창한12/27/20198077dsoframer ocx [3]
5278guest12/27/20196984CLR 스레드 풀 관련 질문 [1]
5277방문자12/26/20196807WindowsForm 질문드립니다. [3]
5276진우12/17/20198548c++/c# 에도 파이썬 가상환경 같은 기능 혹시 있는지 궁금합니다. [3]
5275송재필12/17/20198217아래 'c#8.0 프로그래밍 교제 예제 관련 문의 드립니다' 의 원인이 압축 파일의 문제인듯 합니다. [2]파일 다운로드1
5272정영훈12/13/20198387byte => string => byte 변환 문의드립니다. [5]파일 다운로드1
5270김세미12/3/20198111c#8.0 프로그래밍 교제 예제 관련 문의 드립니다. [4]
5269달려라라...12/2/20198253C# winform(framework) tabcontrol 에서 button 함수 관련 질문 [3]파일 다운로드1
5266엔벌잉11/26/20197205라즈베리파이 autostart관련 질문 [2]
5265해나11/25/20197266C# 6.0 책 내용 문의 [1]
5264김혜원11/18/20199640C# CodeSign에 대해 여쭤볼 것이 있습니다 [4]
5263정환맨11/17/20197906Task관련 질문입니다 [3]
5262닷린이11/14/20199335Dispatcher 와 synchronizationcontext의 관계가 궁금합니다. [6]
5260방문자11/13/20198289안녕하세요 도움받고 싶습니다 [1]
5259ming11/13/20197345string타입 파라메터로 넘길때 메모리 내부가 궁금합니다. [3]
5258C#초보11/13/20199163DCOM COM+ 등록 관련 문의드립니다. [7]
5257C#초보11/9/20197784파일 저장 방법에 대해 조언 부탁드립니다. [3]
... 16  17  18  19  20  21  22  23  24  [25]  26  27  28  29  30  ...