Пример #1
0
    private void FillDropDown()
    {
        ddlHomeBranch.DataSource     = branchProvider.GetActiveBranches();
        ddlHomeBranch.DataTextField  = "Name";
        ddlHomeBranch.DataValueField = "ID";
        ddlHomeBranch.DataBind();
        ddlHomeBranch.Items.Insert(0, String.Empty);

        ddlFindHomeBranch.DataSource     = branchProvider.GetActiveBranches();
        ddlFindHomeBranch.DataTextField  = "Name";
        ddlFindHomeBranch.DataValueField = "ID";
        ddlFindHomeBranch.DataBind();
        ddlFindHomeBranch.Items.Insert(0, new ListItem("All Branches", "0"));
    }
Пример #2
0
    public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
    {
        using (FitnessManagement.Data.FitnessDataContext ctx = new FitnessManagement.Data.FitnessDataContext())
        {
            BranchProvider branchProvider = new BranchProvider(ctx);
            if (branchProvider.GetActiveBranches(HttpContext.Current.User.Identity.Name).Count() == 0)
            {
                return(false);
            }
        }

        foreach (string role in node.Roles)
        {
            if (role == "" || role == "*")
            {
                return(true);
            }
            if (Roles.IsUserInRole(role))
            {
                return(true);
            }
        }

        return(false);
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ddlYear.DataSource = monthlyClosingProvider.GetClosingYears();
            ddlYear.DataBind();
            ddlYear.SelectedValue = DateTime.Today.Year.ToString();

            ddlMonth.DataSource     = CommonHelper.GetMonthNames();
            ddlMonth.DataValueField = "Key";
            ddlMonth.DataTextField  = "Value";
            ddlMonth.DataBind();
            ddlMonth.SelectedValue = DateTime.Today.Month.ToString();

            ddlBranch.DataSource     = branchProvider.GetActiveBranches(HttpContext.Current.User.Identity.Name);
            ddlBranch.DataTextField  = "Name";
            ddlBranch.DataValueField = "ID";
            ddlBranch.DataBind();

            WebFormHelper.InjectSubmitScript(this, "Are you sure want to process closing ?", "Processing...", btnProses, true);
            WebFormHelper.InjectSubmitScript(this, "Are you sure want to undo process closing ?", "Processing...", btnUnProses, true);
        }

        RefreshGrid();
    }
Пример #4
0
 private void FillDropDown()
 {
     ddlFindBranch.DataSource     = branchProvider.GetActiveBranches();
     ddlFindBranch.DataTextField  = "Name";
     ddlFindBranch.DataValueField = "ID";
     ddlFindBranch.DataBind();
 }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         var branches = branchProvider.GetActiveBranches(User.Identity.Name);
         PopulateBranches(branches);
     }
 }
Пример #6
0
    private void FillDropDown()
    {
        ddlBranch.DataSource     = branchProvider.GetActiveBranches();
        ddlBranch.DataTextField  = "Name";
        ddlBranch.DataValueField = "ID";
        ddlBranch.DataBind();

        ddlBranch.SelectedValue = userProvider.GetCurrentActiveBranches(User.Identity.Name).ToList()[0].ID.ToString();
    }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         ddlBranch.DataSource     = branchProvider.GetActiveBranches(User.Identity.Name);
         ddlBranch.DataTextField  = "Name";
         ddlBranch.DataValueField = "ID";
         ddlBranch.DataBind();
     }
 }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ddlFindBranch.DataSource     = branchProvider.GetActiveBranches();
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();

            calContractDateFrom.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
        }
    }
Пример #9
0
        public static void PopulateActiveBranches(BranchProvider branchProvider, RadDropDownList dropdown, string userName, bool addEmptyOption = false)
        {
            dropdown.DataSource     = branchProvider.GetActiveBranches(userName);
            dropdown.DataTextField  = "Name";
            dropdown.DataValueField = "ID";
            dropdown.DataBind();

            if (addEmptyOption)
            {
                dropdown.Items.Insert(0, new DropDownListItem(String.Empty));
            }
        }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            cblCustomerStatus.DataSource     = customerStatusProvider.GetAll();
            cblCustomerStatus.DataTextField  = "Description";
            cblCustomerStatus.DataValueField = "ID";
            cblCustomerStatus.DataBind();

            DynamicControlBinding.BindDropDown(ddlBranch, branchProvider.GetActiveBranches(), "Name", "ID", false);
        }
    }
Пример #11
0
    private void FillDropDown()
    {
        ddlArea.DataSource     = areaProvider.GetAll();
        ddlArea.DataTextField  = "Description";
        ddlArea.DataValueField = "ID";
        ddlArea.DataBind();
        ddlArea.Items.Insert(0, new ListItem(String.Empty, "0"));

        ddlFindBranch.DataSource     = branchProvider.GetActiveBranches();
        ddlFindBranch.DataTextField  = "Name";
        ddlFindBranch.DataValueField = "ID";
        ddlFindBranch.DataBind();


        ddlBillingType.DataSource     = billingTypeProvider.GetActiveBillingTypes();
        ddlBillingType.DataTextField  = "Description";
        ddlBillingType.DataValueField = "ID";
        ddlBillingType.DataBind();
        ddlBillingType.Items.Insert(0, String.Empty);

        ddlPackage.DataSource     = packageProvider.GetPackagesInBranch(Convert.ToInt32(ddlFindBranch.SelectedValue));
        ddlPackage.DataTextField  = "Name";
        ddlPackage.DataValueField = "ID";
        ddlPackage.DataBind();
        ddlPackage.Items.Insert(0, String.Empty);

        ddlBillingBank.DataSource     = bankProvider.GetActiveBanks();
        ddlBillingBank.DataTextField  = "Name";
        ddlBillingBank.DataValueField = "ID";
        ddlBillingBank.DataBind();
        ddlBillingBank.Items.Insert(0, String.Empty);


        ddlCardExpiredMonth.DataSource     = CommonHelper.GetMonthNames();
        ddlCardExpiredMonth.DataTextField  = "Value";
        ddlCardExpiredMonth.DataValueField = "Key";
        ddlCardExpiredMonth.DataBind();
        ddlCardExpiredMonth.SelectedValue = DateTime.Today.Month.ToString();

        ddlCardExpiredYear.DataSource = Enumerable.Range(2005, DateTime.Today.Year + 10 - 2005);
        ddlCardExpiredYear.DataBind();
        ddlCardExpiredYear.SelectedValue = DateTime.Today.Year.ToString();

        ddlMonthlyDuesItem.DataSource     = itemProvider.GetMonthlyDuesItem();
        ddlMonthlyDuesItem.DataTextField  = "Description";
        ddlMonthlyDuesItem.DataValueField = "ID";
        ddlMonthlyDuesItem.DataBind();
        ddlMonthlyDuesItem.Items.Insert(0, String.Empty);


        DataBindingHelper.PopulateCreditCardTypes(ddlBillingCardType, true);
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Cache.Insert(System.Web.Caching.Cache.
        if (!this.IsPostBack)
        {
            ddlBranch.DataSource     = branchProvider.GetActiveBranches();
            ddlBranch.DataTextField  = "Name";
            ddlBranch.DataValueField = "ID";
            ddlBranch.DataBind();

            calDateFrom.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
        }
    }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ddlFindBranch.DataSource     = branchProvider.GetActiveBranches();
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();

            chkUnknownBirthDateFrom.Checked = true;
            chkUnknownBirthDateTo.Checked   = true;
        }
    }
Пример #14
0
    public static void PopulateActiveBranches(DropDownList dropdown, string userName, bool addEmptyOption = false)
    {
        BranchProvider branchProvider = UnityContainerHelper.Container.Resolve <BranchProvider>();

        dropdown.DataSource     = branchProvider.GetActiveBranches(userName);
        dropdown.DataTextField  = "Name";
        dropdown.DataValueField = "ID";
        dropdown.DataBind();

        if (addEmptyOption)
        {
            dropdown.Items.Insert(0, String.Empty);
        }
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            cblMembershipType.DataSource     = packageProvider.GetAll();
            cblMembershipType.DataTextField  = "Name";
            cblMembershipType.DataValueField = "ID";
            cblMembershipType.DataBind();

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

            DynamicControlBinding.BindDropDown(ddlBillingType, billingTypeProvider.GetActiveBillingTypes().Where(bt => bt.ID > 1), "Description", "ID", false);
            DynamicControlBinding.BindDropDown(ddlBranch, branchProvider.GetActiveBranches(), "Name", "ID", 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);
        }
    }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //this.ApplyUserSecurity(lnbAddNew, lnbDelete, btnSave, gvwMaster);
        if (!this.IsPostBack)
        {
            mvwForm.ActiveViewIndex     = 0;
            ViewState["_Sort"]          = "UserName";
            ViewState["_SortDirection"] = SortDirection.Ascending;

            ddlFindRoles.DataSource = Roles.GetAllRoles();
            ddlFindRoles.DataBind();

            ddlRole.DataSource = Roles.GetAllRoles();
            ddlRole.DataBind();
            ddlRole.Items.Insert(0, String.Empty);
            ddlRole.SelectedIndex = 0;

            ddlHomeBranch.DataSource     = branchProvider.GetActiveBranches();
            ddlHomeBranch.DataTextField  = "Name";
            ddlHomeBranch.DataValueField = "ID";
            ddlHomeBranch.DataBind();
            ddlHomeBranch.Items.Insert(0, String.Empty);
        }
    }