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

1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5781List맨1/5/20233903List.Add("newobj") 속도는 빠른 편인지요? [11]
5780임세1/3/20234475C# 프로그래밍 10 책 구매한 사람입니다. 3부 자료는 어디서 다운 받을 수 있나요? [4]
5779이건우1/2/20233349안녕하십니까 루프안에서 메세지처리에 관하여 질문드립니다! [2]
5778이건우12/30/20224662안녕하세요 c#에서 dll참조 관련 질문드립니다. [4]
5777감사합니...12/29/20223622UI Thread에 Invoke 처리관련 궁금합니다. [3]
5776pdf맨12/28/20223410C# MouseUp Event + pdf [10]
5775민성12/28/20223197안녕하세요 Class 관련해서 예외처리를 하나로 받아낼수 있는 방법 [1]
5774중급12/27/20224002중급개발자란 어느 수준인지요? [4]
5773김영식12/26/20223582c# 압축파일 읽어 올 때 BinaryRead 한글 처리 문제 [1]
5772눈송이12/26/20223662Excel VSTO 는 왜 Net Core, Net 5, 6 버전을 사용하지 않나요? [2]
5771김훈12/26/20223760c# .net client application 망분리(내부망,외부망) 환경에서 의문의 외부사이트 호출 대기 [2]
5770lsh12/26/20223378클라우디움안에 있는 파일을 File.Copy 하고싶은데 코드로는 접근을 못하나요? [1]
5769울타리12/20/20223405Active Directory 2012R2 2016 또는 2019 마이그렝션 문의 드립니다. [1]
5768c++12/14/20224176Thread를 사용한 C++ DLL에 관련된 질문입니다. [6]파일 다운로드2
5767민성12/9/20223516안녕하세요 ashx로 화일을 저장하고 화일명을 리턴하는데요 [1]
5766김명훈12/9/20223663웹브라우저에서 묻지 않고 바로 다운로드 [2]
5765hong12/1/20223919Winform(.Net6) 클라이언트에서 SignalR Core 웹서버에 접속시 인증서 문제 [3]파일 다운로드1
5764요한11/30/20224096c++ 동일한 객체인지 비교 방법문의 [2]
5763고필석11/30/20223620시작하자마자 비정상 종료하는 프로세스에 대한 문제 해결 조언 요청 드립니다. [3]
5762흰털너부리11/30/20223597wpf mvvm ui update 로딩중 표시 [1]
5761민성11/29/20223503죄송하지만 한가지만 더 여쭈어 보겠습니다 [1]
5760민성11/29/20223425안녕하세요 [2]
5759문정환11/28/20223766c# socket 통신할때 빅엔디언으로 바꿔줘야 하나요? [1]
5758라떼11/28/20224996Linux 에서 winform UI 어플리케이션 실행하기 [3]
5757흰털너부리11/25/20223926asp.net core EF AddDbContext,AddDbContextFactory 차이점 알려주세요 [1]
5756흰털너부리11/25/20223496asp.net core web api에서 json 특정 property 무시하는 방법 문의 드립니다. System.Text.Json 사용중입니다. [1]
1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...