Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                cblMembershipType.DataSource     = PackageService.GetAll();
                cblMembershipType.DataTextField  = "Name";
                cblMembershipType.DataValueField = "ID";
                cblMembershipType.DataBind();

                cblCustomerStatus.DataSource     = CustomerStatusService.GetAll();
                cblCustomerStatus.DataTextField  = "Description";
                cblCustomerStatus.DataValueField = "ID";
                cblCustomerStatus.DataBind();

                DynamicControlBinding.BindDropDown(ddlBillingType, BillingTypeService.GetActiveBillingTypes().Where(bt => bt.ID > 1), "Description", "ID", false);
                DynamicControlBinding.BindDropDown(ddlBranch, BranchService.GetActiveBranches(User.Identity.Name), "Name", "ID", false);

                ddlBranch.Enabled = false;

                calFindDateFrom.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                calFindDateTo.SelectedDate   = DateTime.Today;
                cblMembershipType.Items.Cast <ListItem>().ToList().ForEach(item => item.Selected = true);
            }
        }