Esempio n. 1
0
        private void LoadBillingCyclesDDL()
        {
            int cyclesCount = PlanBillingCycles.Count;

            // load taken cycles
            int[] cyclesTaken = new int[cyclesCount];
            // build array
            for (int i = 0; i < cyclesCount; i++)
            {
                cyclesTaken[i] = PlanBillingCycles[i].CycleId;
            }

            // bind loaded cycles
            BillingCycle[] cyclesToBind = StorehouseHelper.GetBillingCyclesFree(cyclesTaken);
            // show button while at least one cycle available
            phBillingCycles.Visible = (cyclesToBind.Length > 0);
            // bind cycles
            if (cyclesToBind.Length > 0)
            {
                ddlBillingCycles.DataSource = cyclesToBind;
                ddlBillingCycles.DataBind();
            }
        }