Beispiel #1
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();
            }
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         var branches = BranchService.GetAllowedBranches(User.Identity.Name);
         PopulateBranches(branches);
         calDate.SelectedDate = DateTime.Today;
     }
 }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ddlFindBranch.DataSource     = BranchService.GetAllowedBranches(User.Identity.Name);
                ddlFindBranch.DataTextField  = "Name";
                ddlFindBranch.DataValueField = "ID";
                ddlFindBranch.DataBind();
                ddlFindBranch.SelectedValue = Convert.ToString(HomeBranchID);

                chkUnknownBirthDateFrom.Checked = true;
                chkUnknownBirthDateTo.Checked   = true;
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ddlBranch.DataSource     = BranchService.GetAllowedBranches(User.Identity.Name);
                ddlBranch.DataTextField  = "Name";
                ddlBranch.DataValueField = "ID";
                ddlBranch.DataBind();
                ddlBranch.SelectedValue = Convert.ToString(HomeBranchID);

                ddlYear.DataSource = BillingService.GetYears();
                ddlYear.DataBind();
                ddlYear.SelectedText = DateTime.Today.Year.ToString(CultureInfo.InvariantCulture);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ddlBranch.DataSource     = BranchService.GetAllowedBranches(User.Identity.Name);
                ddlBranch.DataTextField  = "Name";
                ddlBranch.DataValueField = "ID";
                ddlBranch.DataBind();
                ddlBranch.SelectedValue = Convert.ToString(HomeBranchID);

                RadHelper.SetUpDatePickers(calDateFrom, calDateTo, calPaymentDateFrom, calPaymentDateTo);
                calDateFrom.SelectedDate        = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                calPaymentDateFrom.SelectedDate = DateTime.Today.AddYears(-1);
                calPaymentDateTo.SelectedDate   = DateTime.Today;
                calDateTo.SelectedDate          = DateTime.Today;
            }
        }
        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();
            }
        }