Beispiel #1
0
        protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlItem.SelectedIndex > 0)
            {
                cblBranches.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                cblBranches.DataValueField = "ID";
                cblBranches.DataTextField  = "Name";
                cblBranches.DataBind();

                foreach (ListItem item in cblBranches.Items)
                {
                    item.Selected = false;
                }

                int[] branchesID = ItemService.GetBranchesByItem(Convert.ToInt32(ddlItem.SelectedValue)).ToArray();
                foreach (var branchID in branchesID)
                {
                    cblBranches.Items.FindByValue(branchID.ToString()).Selected = true;
                }

                btnSave.Enabled = true;
            }
            else
            {
                cblBranches.DataSource = null;
                cblBranches.DataBind();
            }
        }
Beispiel #2
0
        private void FillDropDown()
        {
            ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();

            ddlArea.DataSource     = AreaService.GetAll();
            ddlArea.DataTextField  = "Description";
            ddlArea.DataValueField = "ID";
            ddlArea.DataBind();
            ddlArea.Items.Insert(0, new DropDownListItem(String.Empty));

            ddlCreditCardType.DataSource     = CreditCardTypeService.GetAll();
            ddlCreditCardType.DataTextField  = "Description";
            ddlCreditCardType.DataValueField = "ID";
            ddlCreditCardType.DataBind();

            ddlOccupation.DataSource     = OccupationService.GetAll();
            ddlOccupation.DataTextField  = "Description";
            ddlOccupation.DataValueField = "ID";
            ddlOccupation.DataBind();
            ddlOccupation.Items.Insert(0, new DropDownListItem(String.Empty));

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

            DataBindingHelper.PopulateBillingTypes(BillingTypeService, ddlBillingType, false);
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblBrowser.Text = String.Format("{0} - {1} {2}", Request.Browser.Type, Request.Browser.Version, Request.Browser.Platform);
            using (var entities = new FitnessEntities())
            {
                using (var connection = entities.Connection)
                {
                    if (connection.State != ConnectionState.Open)
                    {
                        connection.Open();
                    }

                    lblDatabaseServer.Text = String.Format("{0} on {1} ({2})",
                                                           entities.Connection.Database,
                                                           entities.Connection.DataSource,
                                                           entities.Connection.ServerVersion);
                }
            }
            bulBranch.DataSource    = BranchService.GetActiveBranches(User.Identity.Name);
            bulBranch.DataTextField = "Name";
            bulBranch.DataBind();

            bulAllowedBranch.DataSource    = BranchService.GetAllowedBranches(User.Identity.Name);
            bulAllowedBranch.DataTextField = "Name";
            bulAllowedBranch.DataBind();

            hypAlerts.Visible = !String.IsNullOrEmpty(Request["FromAlert"]);

            if (!Page.IsPostBack)
            {
                RadScheduler1.SelectedDate = DateTime.Today;
                BindData();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                mvwForm.ActiveViewIndex     = 0;
                ViewState["_Sort"]          = "UserName";
                ViewState["_SortDirection"] = SortDirection.Ascending;

                ddlFindRoles.DataSource     = SecurityService.GetAllRoles();
                ddlFindRoles.DataValueField = "ID";
                ddlFindRoles.DataTextField  = "Name";
                ddlFindRoles.DataBind();

                ddlRole.DataSource     = SecurityService.GetAllRoles();
                ddlRole.DataValueField = "ID";
                ddlRole.DataTextField  = "Name";
                ddlRole.DataBind();
                ddlRole.Items.Insert(0, new DropDownListItem(String.Empty));
                ddlRole.SelectedIndex = 0;

                ddlHomeBranch.DataSource     = BranchService.GetActiveBranches();
                ddlHomeBranch.DataTextField  = "Name";
                ddlHomeBranch.DataValueField = "ID";
                ddlHomeBranch.DataBind();
                ddlHomeBranch.Items.Insert(0, new DropDownListItem(String.Empty));
            }
        }
Beispiel #5
0
 private void FillDropDown()
 {
     ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
     ddlFindBranch.DataTextField  = "Name";
     ddlFindBranch.DataValueField = "ID";
     ddlFindBranch.DataBind();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                calFindFromDate.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                calFindToDate.SelectedDate   = DateTime.Today;

                ddlDocumentType.DataSource     = DocumentService.GetAllDocumentTypes();
                ddlDocumentType.DataTextField  = "Description";
                ddlDocumentType.DataValueField = "ID";
                ddlDocumentType.DataBind();
                ddlDocumentType.SelectedIndex = 0;

                ddlFindDocumentType.DataSource     = DocumentService.GetAllDocumentTypes();
                ddlFindDocumentType.DataTextField  = "Description";
                ddlFindDocumentType.DataValueField = "ID";
                ddlFindDocumentType.DataBind();
                ddlFindDocumentType.Items.Insert(0, new DropDownListItem(String.Empty, "0"));

                ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                ddlFindBranch.DataTextField  = "Name";
                ddlFindBranch.DataValueField = "ID";
                ddlFindBranch.DataBind();
                ddlFindBranch.SelectedIndex = 0;
                ddlFindBranch.Enabled       = false;
            }
        }
        private void FillDropDown(bool isAddNew = true)
        {
            ddlArea.DataSource     = AreaService.GetAll();
            ddlArea.DataTextField  = "Description";
            ddlArea.DataValueField = "ID";
            ddlArea.DataBind();
            ddlArea.Items.Insert(0, new ListItem(String.Empty, "0"));

            ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();


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

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

            ddlOccupation.DataSource     = OccupationService.GetAll();
            ddlOccupation.DataValueField = "ID";
            ddlOccupation.DataTextField  = "Description";
            ddlOccupation.DataBind();
            ddlOccupation.Items.Insert(0, new DropDownListItem(String.Empty));

            ddlBillingBank.DataSource     = BankService.GetActiveBanks(isAddNew);
            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(CultureInfo.InvariantCulture);

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

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

            DataBindingHelper.PopulateCreditCardTypes(CreditCardTypeService, ddlBillingCardType, true);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         mvwForm.SetActiveView(View1);
         var branches = BranchService.GetActiveBranches(User.Identity.Name);
         PopulateBranches(branches);
     }
 }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         var branches = BranchService.GetActiveBranches(User.Identity.Name);
         PopulateBranches(branches);
         calDate.SelectedDate = DateTime.Today;
     }
 }
        private void FillDropDown()
        {
            ddlBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlBranch.DataTextField  = "Name";
            ddlBranch.DataValueField = "ID";
            ddlBranch.DataBind();

            ddlBranch.SelectedValue = Request.QueryString["BranchID"];
            //UserService.GetCurrentActiveBranches(User.Identity.Name).ToList()[0].ID.ToString();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         ddlBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
         ddlBranch.DataTextField  = "Name";
         ddlBranch.DataValueField = "ID";
         ddlBranch.DataBind();
         ddlBranch.Items.Insert(0, new DropDownListItem("Select branch"));
         btnSave.Enabled = false;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                cblCustomerStatus.DataSource     = CustomerStatusService.GetAll();
                cblCustomerStatus.DataTextField  = "Description";
                cblCustomerStatus.DataValueField = "ID";
                cblCustomerStatus.DataBind();

                DynamicControlBinding.BindDropDown(ddlBranch, BranchService.GetActiveBranches(User.Identity.Name), "Name", "ID", false);
                ddlBranch.Enabled = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Cache.Insert(System.Web.Caching.Cache.
            if (!this.IsPostBack)
            {
                ddlBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                ddlBranch.DataTextField  = "Name";
                ddlBranch.DataValueField = "ID";
                ddlBranch.DataBind();

                calDateFrom.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                calDateTo.SelectedDate   = DateTime.Today;
            }
        }
        private void FillDropDown()
        {
            ddlBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlBranch.DataTextField  = "Name";
            ddlBranch.DataValueField = "ID";
            ddlBranch.DataBind();
            //ddlBranch.Enabled = ddlBranch.Items.Count > 0;

            ddlPaymentType.DataSource     = PaymentTypeService.GetAll();
            ddlPaymentType.DataTextField  = "Description";
            ddlPaymentType.DataValueField = "ID";
            ddlPaymentType.DataBind();

            ddlBranch_SelectedIndexChanged(null, null);
        }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ddlBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
                ddlBranch.DataTextField  = "Name";
                ddlBranch.DataValueField = "ID";
                ddlBranch.DataBind();
                ddlBranch.Enabled = false;

                ddlYear.DataSource = BillingService.GetYears();
                ddlYear.DataBind();
                ddlYear.SelectedText = Convert.ToString(DateTime.Today.Year);
            }
        }
        private void FillDropDown()
        {
            ddlFindBranch.DataSource     = BranchService.GetActiveBranches(User.Identity.Name);
            ddlFindBranch.DataTextField  = "Name";
            ddlFindBranch.DataValueField = "ID";
            ddlFindBranch.DataBind();

            cboSupplier.DataSource     = SupplierService.GetSuppliers();
            cboSupplier.DataTextField  = "Name";
            cboSupplier.DataValueField = "ID";
            cboSupplier.DataBind();

            ddlTerms.DataSource     = PurchaseOrderService.GetTerms();
            ddlTerms.DataValueField = "Name";
            ddlTerms.DataTextField  = "Name";
            ddlTerms.DataBind();

            cboSupplier.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem(String.Empty));
        }
        protected void ddlUser_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlUser.SelectedIndex > 0)
            {
                cblBranches.DataSource     = BranchService.GetActiveBranches();
                cblBranches.DataValueField = "ID";
                cblBranches.DataTextField  = "Name";
                cblBranches.DataBind();
                foreach (var item in BranchService.GetAllowedBranches(ddlUser.SelectedValue))
                {
                    cblBranches.Items.FindByValue(item.ID.ToString()).Selected = true;
                }

                btnSave.Enabled = true;
            }
            else
            {
                cblBranches.DataSource = null;
                cblBranches.DataBind();
            }
        }
Beispiel #18
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);
            }
        }