コード例 #1
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;

            var clientData = ClientDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(clientData, drpClientList, StandardDataModel.StandardDataColumns.Name, ClientDataModel.DataColumns.ClientId);

            var projectData = ProjectDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(projectData, drpProjectList, StandardDataModel.StandardDataColumns.Name, ProjectDataModel.DataColumns.ProjectId);

            if (isTesting)
            {
                drpProjectList.AutoPostBack = true;
                drpClientList.AutoPostBack  = true;

                if (drpClientList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtClientId.Text.Trim()))
                    {
                        drpClientList.SelectedValue = txtClientId.Text;
                    }
                    else
                    {
                        txtClientId.Text = drpClientList.SelectedItem.Value;
                    }
                }

                if (drpProjectList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtProjectId.Text.Trim()))
                    {
                        drpProjectList.SelectedValue = txtProjectId.Text;
                    }
                    else
                    {
                        txtProjectId.Text = drpProjectList.SelectedItem.Value;
                    }
                }

                txtClientId.Visible  = true;
                txtProjectId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtClientId.Text.Trim()))
                {
                    drpClientList.SelectedValue = txtClientId.Text;
                }
                if (!string.IsNullOrEmpty(txtProjectId.Text.Trim()))
                {
                    drpProjectList.SelectedValue = txtProjectId.Text;
                }
            }
        }
コード例 #2
0
        //Tab Control supporting methods
        private DataTable GetClientList()
        {
            var list = ClientDataManager.GetList(SessionVariables.RequestProfile);

            return(list);
        }