コード例 #1
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("Application"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("systemEntityType"))
            {
                var systemEntityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "systemEntityType", SessionVariables.RequestProfile);
                var systemEntityDataList     = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                var filteredsystemEntityData = GetFilteredList("systemEntityType", systemEntityData, systemEntityDataList);
                filteredsystemEntityData.DefaultView.Sort = SystemEntityTypeDataModel.DataColumns.EntityName + " ASC";
                var sorteddt = filteredsystemEntityData.DefaultView.ToTable();
                UIHelper.LoadDropDown(sorteddt, dropDownListControl, SystemEntityTypeDataModel.DataColumns.EntityName,
                                      SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("Functionality"))
            {
                var functionalityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "Functionality", SessionVariables.RequestProfile);
                var functionalityDataList     = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                var filteredfunctionalityData = GetFilteredList("Functionality", functionalityData, functionalityDataList);
                UIHelper.LoadDropDown(filteredfunctionalityData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }

            else if (fieldName.Equals("FunctionalityPriority"))
            {
                var functionalityPriorityData = FunctionalityPriorityDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityPriorityData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityPriorityDataModel.DataColumns.FunctionalityPriorityId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var functionalityActiveStatusData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityActiveStatusData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }

            dropDownListControl.SelectedIndex = 0;
        }
コード例 #2
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            var dataFES = new FunctionalityEntityStatusDataModel();

            dataFES.FunctionalityId = FunctionalityId;

            var fesData = FunctionalityEntityStatusDataManager.Search(dataFES, SessionVariables.RequestProfile);

            if (fesData.Rows.Count == 0)
            {
                var dtMenu = MenuDataManager.GetList(SessionVariables.RequestProfile);

                var entitydt = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);

                //get data based on Entity Name from Menu and SystemEntity table to get the Primary Developer value

                var assignedTo = from tblMenu in dtMenu.AsEnumerable()
                                 join tblEntity in entitydt.AsEnumerable() on tblMenu.Field <string>(MenuDataModel.DataColumns.Name) equals tblEntity.Field <string>(SystemEntityTypeDataModel.DataColumns.EntityName)
                                 select tblEntity;

                //get data from SystemEntity table which doesnt have matching entries in Menu table

                var assignedToAdmin = from tblEntity in entitydt.AsEnumerable()
                                      where !assignedTo.Contains(tblEntity)
                                      select tblEntity;

                string assignedToValue = string.Empty;

                //data inserted to FES with AssignedTo value as PrimaryDeveloper value

                for (int i = 0; i < assignedTo.Count(); i++)
                {
                    var primaryDeveloper = from tblMenu in dtMenu.AsEnumerable()
                                           join tblEntity in entitydt.AsEnumerable() on tblMenu.Field <string>(MenuDataModel.DataColumns.Name) equals tblEntity.Field <string>(SystemEntityTypeDataModel.DataColumns.EntityName)
                                               where tblMenu.Field <string>(MenuDataModel.DataColumns.Name) == assignedTo.CopyToDataTable().Rows[i][SystemEntityTypeDataModel.DataColumns.EntityName].ToString()
                                           select tblMenu[MenuDataModel.DataColumns.PrimaryDeveloper];

                    assignedToValue = primaryDeveloper.First().ToString();

                    Insert(assignedTo.CopyToDataTable().Rows[i], assignedToValue);
                }

                //data inserted to FES with AssignedTo value as "Admin"

                for (int j = 0; j < assignedToAdmin.Count(); j++)
                {
                    assignedToValue = "Admin";

                    Insert(assignedToAdmin.CopyToDataTable().Rows[j], assignedToValue);
                }
            }
        }
コード例 #3
0
        private void SetupSystemEntityDropdown()
        {
            drpSystemEntity.Items.Clear();
            var dt = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    drpSystemEntity.Items.Add(Convert.ToString(dr["EntityName"]));
                }
            }
        }
コード例 #4
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;

            var systemEntityTypeData = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(systemEntityTypeData, drpSystemEntityTypeList,
                                  SystemEntityTypeDataModel.DataColumns.EntityName,
                                  SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);

            var functionalityData = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(functionalityData, drpFunctionalityList,
                                  StandardDataModel.StandardDataColumns.Name,
                                  FunctionalityDataModel.DataColumns.FunctionalityId);

            var functionalityStatusData = FunctionalityStatusDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(functionalityStatusData, drpFunctionalityStatusList,
                                  StandardDataModel.StandardDataColumns.Name,
                                  FunctionalityStatusDataModel.DataColumns.FunctionalityStatusId);

            var functionalityPriorityData = FunctionalityPriorityDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(functionalityPriorityData, drpFunctionalityPriorityList,
                                  StandardDataModel.StandardDataColumns.Name,
                                  FunctionalityPriorityDataModel.DataColumns.FunctionalityPriorityId);

            if (isTesting)
            {
                drpSystemEntityTypeList.AutoPostBack      = true;
                drpFunctionalityList.AutoPostBack         = true;
                drpFunctionalityStatusList.AutoPostBack   = true;
                drpFunctionalityPriorityList.AutoPostBack = true;

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

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

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

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

                txtSystemEntityTypeId.Visible      = true;
                txtFunctionalityId.Visible         = true;
                txtFunctionalityStatusId.Visible   = true;
                txtFunctionalityPriorityId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtSystemEntityTypeId.Text.Trim()))
                {
                    drpSystemEntityTypeList.SelectedValue = txtSystemEntityTypeId.Text;
                }

                if (!string.IsNullOrEmpty(txtFunctionalityId.Text.Trim()))
                {
                    drpFunctionalityList.SelectedValue = txtFunctionalityId.Text;
                }

                if (!string.IsNullOrEmpty(txtFunctionalityStatusId.Text.Trim()))
                {
                    drpFunctionalityStatusList.SelectedValue = txtFunctionalityStatusId.Text;
                }

                if (!string.IsNullOrEmpty(txtFunctionalityPriorityId.Text.Trim()))
                {
                    drpFunctionalityPriorityList.SelectedValue = txtFunctionalityPriorityId.Text;
                }

                txtSystemEntityTypeId.Visible      = false;
                txtFunctionalityId.Visible         = false;
                txtFunctionalityStatusId.Visible   = false;
                txtFunctionalityPriorityId.Visible = false;
            }
        }