업무용 소스 예제

팀 상태 변경 시 ViewTermStatusChange 처리 예제

안요사님 2021. 9. 6. 10:07
728x90
반응형
728x90

팀 상태 변경 시 ViewTermStatusChange 처리 예제

 

private void ViewTermStatusChange()
        {
            if (this.blnViewTermTF)
            {
                btnViewTermTF.Text = "월간";
                this.dtpEndDate.Visible = true;
                this.btnPrev.Visible = false;
                this.btnNext.Visible = false;
                this.btnToday.Visible = false;
            }
            else
            {
                btnViewTermTF.Text = "기간";
                this.dtpEndDate.Visible = false;
                this.btnPrev.Visible = true;
                this.btnNext.Visible = true;
                this.btnToday.Visible = true;
            }

            switch (this.preNextTerm)
            {
                case PreNextTermDiv.TermOneDay:
                case PreNextTermDiv.TermOneWeek:
                    this.dtpStartDate.Properties.DisplayFormat.FormatString = "yyyy-MM-dd";
                    this.dtpStartDate.Properties.EditFormat.FormatString = "yyyy-MM-dd";
                    break;

                case PreNextTermDiv.TermOneMonth:
                case PreNextTermDiv.TermThreeMonth:
                    this.dtpStartDate.Properties.DisplayFormat.FormatString = "yyyy년 MM월";
                    this.dtpStartDate.Properties.EditFormat.FormatString = "yyyy년 MM월";
                    break;

                case PreNextTermDiv.TermOneYear:
                    this.dtpStartDate.Properties.DisplayFormat.FormatString = "yyyy년";
                    this.dtpStartDate.Properties.EditFormat.FormatString = "yyyy년";
                    break;

                default:
                    this.dtpStartDate.Properties.DisplayFormat.FormatString = "yyyy-MM-dd";
                    this.dtpStartDate.Properties.EditFormat.FormatString = "yyyy-MM-dd";
                    break;
            }

            if (this.blnCustomFormatUseTF)
            {
                this.dtpStartDate.Properties.DisplayFormat.FormatString = this.strCusTomFormat;
                this.dtpStartDate.Properties.EditFormat.FormatString = this.strCusTomFormat;
            }

            this.dtpEndDate.Properties.DisplayFormat.FormatString = "~" + this.dtpStartDate.Properties.DisplayFormat.FormatString;
            this.dtpEndDate.Properties.EditFormat.FormatString = "~" + this.dtpStartDate.Properties.EditFormat.FormatString;

            if (this.blnisEvent)
            {
                if (DateValueChanged != null) DateValueChanged();
                if (DateValueChanged2 != null) DateValueChanged2(this, new EventArgs());
            }
        }

        public string SetCustomFormat
        {
            get
            {
                return this.strCusTomFormat;
            }
            set
            {
                this.strCusTomFormat = value;
                this.ChangeViewTermButton();
            }
        }

        public bool SetCustomFormatUseTF
        {
            get
            {
                return this.blnCustomFormatUseTF;
            }
            set
            {
                this.blnCustomFormatUseTF = value;
                this.ChangeViewTermButton();
            }
        }

        public DateTime SetEndDate
        {
            set
            {
                this.blnisEvent = false;
                this.dtpEndDate.DateTime = value;
                this.blnisEvent = this.blnLoadTF;
            }
        }

        public bool SetEnterToTabTF
        {
            get
            {
                return this.blnEnterToTabTF;
            }
            set
            {
                this.blnEnterToTabTF = value;
            }
        }

        public DateTime SetStartDate
        {
            set
            {
                this.blnisEvent = false;
                this.dtpStartDate.DateTime = value;
                this.blnisEvent = this.blnLoadTF;
            }
        }
728x90
반응형