コード例 #1
0
    public int GetOperationYear(ComboBox cmbYear, HiddenField hfYear)
    {
        int CurrentYear = this.GetCurrentYear();

        for (int i = (CurrentYear + ForwardYearLag - YearLag); i <= (CurrentYear + ForwardYearLag); i++)
        {
            ComboBoxItem cmbItemYear = new ComboBoxItem(i.ToString());
            cmbItemYear.Value = i.ToString();
            cmbYear.Items.Add(cmbItemYear);
        }

        if (HttpContext.Current.Session["CurrentOperationYear"] == null)
        {
            this.operationYearObj.Year  = CurrentYear;
            this.operationYearObj.Index = cmbYear.Items.Count - 2;

            HttpContext.Current.Session.Add("CurrentOperationYear", operationYearObj);
        }
        this.operationYearObj = (OperationYearObj)HttpContext.Current.Session["CurrentOperationYear"];

        hfYear.Value          = this.operationYearObj.Year.ToString();
        cmbYear.SelectedIndex = this.operationYearObj.Index;

        return(CurrentYear);
    }
コード例 #2
0
 public OperationYearMonthProvider()
 {
     this.operationYearObj  = new OperationYearObj();
     this.operationMonthObj = new OperationMonthObj();
 }