private DataTable GetFunctionalityImageData(int functionalityId) { var dt = FunctionalityXFunctionalityImageDataManager.GetByFunctionality(functionalityId, SessionVariables.RequestProfile); var FunctionalityImagedt = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile); var resultdt = FunctionalityImagedt.Clone(); foreach (DataRow row in dt.Rows) { var rows = FunctionalityImagedt.Select("FunctionalityImageId = " + row[FunctionalityImageDataModel.DataColumns.FunctionalityImageId]); resultdt.ImportRow(rows[0]); } return(resultdt); }
private void SetupDropdown() { var isTesting = SessionVariables.IsTesting; var functionalityImageData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(functionalityImageData, drpFunctionalityImageList, FunctionalityImageDataModel.DataColumns.Title, FunctionalityImageDataModel.DataColumns.FunctionalityImageId); if (isTesting) { drpFunctionalityImageList.AutoPostBack = true; if (drpFunctionalityImageList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtFunctionalityImageId.Text.Trim())) { drpFunctionalityImageList.SelectedValue = txtFunctionalityImageId.Text; } else { txtFunctionalityImageId.Text = drpFunctionalityImageList.SelectedItem.Value; } } txtFunctionalityImageId.Visible = true; } else { if (!string.IsNullOrEmpty(txtFunctionalityImageId.Text.Trim())) { drpFunctionalityImageList.SelectedValue = txtFunctionalityImageId.Text; } txtFunctionalityImageId.Visible = false; } }
public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl) { DataTable dataSource = null; if (fieldName.Equals("Application")) { dataSource = ApplicationDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, BaseDataModel.BaseDataColumns.ApplicationId); dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString(); } else if (fieldName.Equals("ParentMenu")) { var data = new MenuDataModel(); var appId = BaseSearchFilterControl.GetParameterValueAsInt("Application"); if (appId.HasValue) { data.ApplicationId = appId.Value; } else { data.ApplicationId = SessionVariables.RequestProfile.ApplicationId; } dataSource = MenuDataManager.ListOfParentMenuOnly(data, SessionVariables.RequestProfile); dataSource.DefaultView.Sort = StandardDataModel.StandardDataColumns.Name + " ASC"; dataSource = dataSource.DefaultView.ToTable(); dropDownListControl.Items.Clear(); dropDownListControl.Items.Add(new ListItem("All", "-1")); dropDownListControl.DataSource = dataSource; dropDownListControl.DataTextField = StandardDataModel.StandardDataColumns.Name; dropDownListControl.DataValueField = MenuDataModel.DataColumns.MenuId; dropDownListControl.DataBind(); } else if (fieldName.Equals("FunctionalityId")) { dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityDataModel.DataColumns.FunctionalityId); } else if (fieldName.Equals("DeveloperRoleId")) { dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, DeveloperRoleDataModel.DataColumns.DeveloperRoleId); } else if (fieldName.Equals("FeatureOwnerStatusId")) { dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId); } else if (fieldName.Equals("EntityId")) { dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId); } else if (fieldName.Equals("ProjectId")) { dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, ProjectDataModel.DataColumns.ProjectId); } else if (fieldName.Equals("ApplicationId")) { 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); } else if (fieldName.Equals("FunctionalityOwner")) { var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); var originalList = new ArrayList(); var duplicateList = new ArrayList(); foreach (DataRow dtRow in drData.Rows) { if (originalList.Contains(dtRow["Developer"])) { duplicateList.Add(dtRow); } else { originalList.Add(dtRow["Developer"]); } } foreach (DataRow dtRow in duplicateList) { drData.Rows.Remove(dtRow); } UIHelper.LoadDropDown(drData, dropDownListControl, FunctionalityOwnerDataModel.DataColumns.Developer, FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId); } else if (fieldName.Equals("FunctionalityActiveStatus")) { var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId); } else if (fieldName.Equals("FunctionalityImage")) { var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, FunctionalityImageDataModel.DataColumns.Title, FunctionalityImageDataModel.DataColumns.FunctionalityImageId); } else if (fieldName.Equals("FunctionalityImageAttribute")) { var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId); } }
public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl) { DataTable dataSource = null; if (fieldName.Equals("FunctionalityId")) { dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityDataModel.DataColumns.FunctionalityId); } else if (fieldName.Equals("ProjectId")) { dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, ProjectDataModel.DataColumns.ProjectId); } else if (fieldName.Equals("DeveloperRoleId")) { dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, DeveloperRoleDataModel.DataColumns.DeveloperRoleId); } else if (fieldName.Equals("UseCaseId")) { dataSource = UseCaseDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, UseCaseDataModel.DataColumns.UseCaseId); } else if (fieldName.Equals("NeedId")) { dataSource = NeedDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, NeedDataModel.DataColumns.NeedId); } else if (fieldName.Equals("ProjectUseCaseStatusId")) { dataSource = ProjectUseCaseStatusDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, ProjectUseCaseStatusDataModel.DataColumns.ProjectUseCaseStatusId); } else if (fieldName.Equals("FeatureOwnerStatusId")) { dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId); } else if (fieldName.Equals("EntityId")) { dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId); } else if (fieldName.Equals("ProjectId")) { dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(dataSource, dropDownListControl, StandardDataModel.StandardDataColumns.Name, ProjectDataModel.DataColumns.ProjectId); } else if (fieldName.Equals("ApplicationId")) { 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); } else if (fieldName.Equals("FunctionalityOwner")) { var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); var originalList = new ArrayList(); var duplicateList = new ArrayList(); foreach (DataRow dtRow in drData.Rows) { if (originalList.Contains(dtRow["Developer"])) { duplicateList.Add(dtRow); } else { originalList.Add(dtRow["Developer"]); } } foreach (DataRow dtRow in duplicateList) { drData.Rows.Remove(dtRow); } UIHelper.LoadDropDown(drData, dropDownListControl, FunctionalityOwnerDataModel.DataColumns.Developer, FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId); } else if (fieldName.Equals("FunctionalityActiveStatus")) { var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId); } else if (fieldName.Equals("FunctionalityImage")) { var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, FunctionalityImageDataModel.DataColumns.Title, FunctionalityImageDataModel.DataColumns.FunctionalityImageId); } else if (fieldName.Equals("FunctionalityImageAttribute")) { var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId); } else if (fieldName.Equals("TabParentStructure")) { var drData = TabParentStructureDataManager.GetList(SessionVariables.RequestProfile); CommonSearchParameters(); UIHelper.LoadDropDown(drData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, TabParentStructureDataModel.DataColumns.TabParentStructureId); } }
private void SetupDropdown() { var isTesting = SessionVariables.IsTesting; var functionalityImageData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(functionalityImageData, drpFunctionalityImageList, FunctionalityImageDataModel.DataColumns.Title, FunctionalityImageDataModel.DataColumns.FunctionalityImageId); var functionalityImageAttributeData = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(functionalityImageAttributeData, drpFunctionalityImageAttributeList, StandardDataModel.StandardDataColumns.Name, FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId); if (isTesting) { drpFunctionalityImageList.AutoPostBack = true; drpFunctionalityImageAttributeList.AutoPostBack = true; if (drpFunctionalityImageList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtFunctionalityImageId.Text.Trim())) { drpFunctionalityImageList.SelectedValue = txtFunctionalityImageId.Text; } else { txtFunctionalityImageId.Text = drpFunctionalityImageList.SelectedItem.Value; } } if (drpFunctionalityImageAttributeList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtFunctionalityImageAttributeId.Text.Trim())) { drpFunctionalityImageAttributeList.SelectedValue = txtFunctionalityImageAttributeId.Text; } else { txtFunctionalityImageAttributeId.Text = drpFunctionalityImageAttributeList.SelectedItem.Value; } } txtFunctionalityImageId.Visible = true; txtFunctionalityImageAttributeId.Visible = true; } else { if (!string.IsNullOrEmpty(txtFunctionalityImageId.Text.Trim())) { drpFunctionalityImageList.SelectedValue = txtFunctionalityImageId.Text; } if (!string.IsNullOrEmpty(txtFunctionalityImageAttributeId.Text.Trim())) { drpFunctionalityImageAttributeList.SelectedValue = txtFunctionalityImageAttributeId.Text; } txtFunctionalityImageId.Visible = false; txtFunctionalityImageAttributeId.Visible = false; } }