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)
816박진오7/29/200910739다국어 사이트의 컨텐츠 저장 방식에 대해.. [2]
814서광원7/16/200919722IWebBrowser2를 이용한 프로그램에서 javascript의 alert 창 무시하는 법? [1]
813윤상균7/16/200910985비관리코드와의 상호운용에서 마샬링 질문 [1]
812김현우7/13/200911407usercontrol은 mdi container가 될수 없는데 이를 구현할 방법은 무엇일런지요? [2]
811조민수7/3/200911005MSDN Magazine 한글화 않되나요? [1]
810세경6/29/200916308SmartClient Vista 64bit IE7 [4]
809윤석준6/24/200916245IE -nomerge 옵션으로 새창을 열려고 합니다. [1]
808한승훈6/4/200914375dll import하기 위해 struct 구성시에 struct가 struct를 가지고 있고 포함된 struct가 ByValArray형태일때 해결 [1]
806곰티5/26/200912859defcon pro 설치 원천 봉쇄 방법 문의 [3]
802채승수5/8/200912152신뢰사이트 등록/적용에 관해 질문드립니다. [1]
801채승수4/15/200912891IE8 새세션을 코드로 구현할수 없을까요 [1]
800신동열4/7/200913341IE8에서 스마트 클라이언트 로딩 문제 [2]
7993/27/200917039이벤트 로그 오류 [1]
798천해3/26/200913338IE8.0 에 관해 질문 드립니다. [2]
797궁금..3/23/200913232IE 8 관련 질문.. [2]
796정성태3/20/200912194스마트클라이언트와 ActiveX에 관한 질문 [1]
795김기용3/19/200911793[질문] DHTML 다이얼로그 관련 [2]
794박평옥3/18/200912231Vista에서 URL Shortcut 실행 시 SetSite가 두 번 호출되는 증상에 관해 조언 부탁드립니다. [2]
792김기용3/12/200911375어제 세미나 잘 들었습니다. 질문사항이 있습니다.(ie8 마이그레이션 관련) [4]
791vb표성백2/17/200916605ATL 로 만든 COM 에 문자열 전달하기! C#에서 어떻게 하나요? [1]
790고민중2/16/20099703vista에 vs2005를 사용중입니다. [1]
789지언2/14/200911832MFC & C#(COM) 호환 관련하여 답변좀 부탁드립니다 [2]
788하루야채2/3/200911060스마트클라이언트 Windowless 설정에 대해서 문의드립니다. [2]
787궁금이2/2/200911316TFS 관련하여 질문드리고자 합니다. [2]
786맨날맑음1/30/200912377WPF를 SmartClient로 배포할순 없을까요? [2]
785정성우12/16/200811651Vista 환경에서 VB6로 개발한 어플리케이션이 IE 통해서는 런칭이 안됩니다.. [4]
... 61  62  63  64  65  66  67  68  [69]  70  71  72  73  74  75  ...