コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PlanDropDown.DataTextField  = "Name";
                PlanDropDown.DataValueField = "Id";
                PlanDropDown.DataSource     = PlanService.LoadActivePlans().ToList();
                PlanDropDown.DataBind();

                List <string> months = new List <string>();
                List <string> years  = new List <string>();

                for (int i = 1; i <= 12; i++)
                {
                    months.Add(i.ToString("D2"));
                }
                ExpireMonth.DataSource = months;
                ExpireMonth.DataBind();

                for (int i = 0; i < 6; i++)
                {
                    years.Add(DateTime.UtcNow.AddYears(i).Year.ToString());
                }
                ExpireYear.DataSource = years;
                ExpireYear.DataBind();
            }
        }
コード例 #2
0
ファイル: Payment.aspx.cs プロジェクト: ManigandanS/supexlms
        protected void Page_Load(object sender, EventArgs e)
        {
            sessionId = Request.QueryString["ssid"];
            courseId  = Request.QueryString["csid"];


            if (!IsPostBack)
            {
                session = SessionService.GetSessionById(SessionVariable.Current.Company.Id, sessionId);
                if (session != null)
                {
                    CostText.Text = session.Cost.ToString();
                }
                else
                {
                    PayBtn.Visible = false;
                }

                List <string> months = new List <string>();
                List <string> years  = new List <string>();

                for (int i = 1; i <= 12; i++)
                {
                    months.Add(i.ToString("D2"));
                }
                ExpireMonth.DataSource = months;
                ExpireMonth.DataBind();

                for (int i = 0; i < 6; i++)
                {
                    years.Add(DateTime.UtcNow.AddYears(i).Year.ToString());
                }
                ExpireYear.DataSource = years;
                ExpireYear.DataBind();
            }
        }