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

... 76  77  78  79  80  [81]  82  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
432정성태7/19/20068333    답변글 [답변]: UpdatePanel(Atlas)위의 SmartClient가 이벤트후 사라집니다. ㅜㅜ
433혁이7/20/20069234        답변글 [답변]: [답변]: UpdatePanel(Atlas)위의 SmartClient가 이벤트후 사라집니다. ㅜㅜ
434정성태7/20/20069708            답변글 [답변]: [답변]: [답변]: UpdatePanel(Atlas) 위의 SmartClient가 이벤트 후 사라집니다. ㅜㅜ [1]
429kwt7/12/20068998ActiveX 개발을 배우고 싶은데요 [3]
427이홍자7/11/20069334스마트 클라이언트 실행 시 그리드의 체크박스가 안보여요.. [1]
426정보문7/11/20069604액티브X 설치2 [1]
423이방은7/9/20068545리소스 임베디드 질문요.. [1]파일 다운로드1
422guest7/6/20068314COM+에서 풀링을 사용할 경우... [1]파일 다운로드1
424guest7/10/20069368    답변글 소스 코드 입니다. [1]
425guest7/11/20068893        답변글 다시 올립니다.파일 다운로드1
428정성태7/11/20068716            답변글 [답변]: 다시 올립니다.
421정보문7/6/20069169액티브X 설치 [1]
1354허재호11/12/20149576    답변글 [답변]: 액티브X 설치
418임대진7/4/20068588이럴적 있으세요?
419정성태7/4/20068661    답변글 [답변]: 이럴적 있으세요?
417이방은6/29/20068435[질문]2.0에서 웹리소스에 대해서 [2]
416박영일6/29/20068722CAS 설정여부 [1]
415김인학6/28/20069356스마트 클라이언트에서 웹서비스를 호출하고 있습니다. [1]
413김성호6/28/20069115IE프로그램문제... [2]
411이진형6/27/20068970어셈블리 네임 알아내기 [2]
414정성태6/28/20068567    답변글 [답변]: 어셈블리 네임 알아내기
410이재원6/26/20068741자바스크립트 스마트클라이언트 이벤트 호출 [3]
412이재원6/27/20068802    답변글 [답변]: 자바스크립트 스마트클라이언트 이벤트 호출
409정준명6/22/20069618윈폼 기반 스마트클라이언트 속도 문제에 대해서 의견을 구합니다. [2]
406이진형6/21/20069789처음에 스마트클라이언트 로딩하는 속도 [1]
4036/20/20068678Invoke 관련 문의 드립니다. [2]
... 76  77  78  79  80  [81]  82  83  84  85  86  87  88  89  90  ...