コード例 #1
0
ファイル: Form_Period.cs プロジェクト: retlav/GesAMFCrepo
        //// <versions>05-12-2017(GesAMFC-v0.0.4.41)</versions>
        public Form_Period(AMFCPeriod objPeriodSelected)
        {
            this.LibAMFC = new Library_AMFC_Methods();
            try
            {
                InitializeComponent();

                ListYears = new AMFCYears();
                ListYears.SetYearList();
                ListMonths = new AMFCMonths();
                ListMonths.SetMonthList();

                this.IsPeriodSelected = false;

                this.PeriodSelected       = new AMFCPeriod();
                this.PeriodSelected.Start = new AMFCPeriodYearMonth();
                this.PeriodSelected.End   = new AMFCPeriodYearMonth();
                if (objPeriodSelected != null)
                {
                    if (objPeriodSelected.Start != null && Program.IsValidYear(objPeriodSelected.Start.Year.Value) && Program.IsValidMonth(objPeriodSelected.Start.Month.Value))
                    {
                        this.PeriodSelected.Start = objPeriodSelected.Start;
                    }
                    else
                    {
                        this.PeriodSelected.Start.Year  = Program.DefaultYear;
                        this.PeriodSelected.Start.Month = Program.DefaultMonth;
                    }

                    if (objPeriodSelected.End != null && Program.IsValidYear(objPeriodSelected.End.Year.Value) && Program.IsValidMonth(objPeriodSelected.End.Month.Value))
                    {
                        this.PeriodSelected.End = objPeriodSelected.End;
                    }
                    else
                    {
                        this.PeriodSelected.End.Year  = Program.DefaultYear;
                        this.PeriodSelected.End.Month = Program.DefaultMonth;
                    }
                }
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }
コード例 #2
0
        /// <versions>01-12-2017(GesAMFC-v0.0.4.41)</versions>
        public Form_Year_Month(AMFCYear objYearSelected, AMFCMonth objMonthSelected)
        {
            this.LibAMFC = new Library_AMFC_Methods();
            try
            {
                InitializeComponent();

                ListYears = new AMFCYears();
                ListYears.SetYearList();
                ListMonths = new AMFCMonths();
                ListMonths.SetMonthList();

                this.IsYearMonthSelected = false;
                this.EveryYear           = false;

                if (Program.IsValidYear(objYearSelected.Value))
                {
                    this.YearSelected = objYearSelected;
                }
                else
                {
                    this.YearSelected = Program.DefaultYear;
                }

                if (Program.IsValidMonth(objMonthSelected.Value))
                {
                    this.MonthSelected = objMonthSelected;
                }
                else
                {
                    this.MonthSelected = Program.DefaultMonth;
                }
            }
            catch (Exception ex)
            {
                Program.HandleError(ex.TargetSite.Name, ex.Message, Program.ErroType.EXCEPTION, true, false);
            }
        }