예제 #1
0
        public void LoadData(int TabParentStructureId, bool showId)
        {
            Clear();

            var data = new TabParentStructureDataModel();

            data.TabParentStructureId = TabParentStructureId;

            var items = TabParentStructureDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            txtIsAllTab.Text = item.IsAllTab.ToString();
            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.TabParentStructureId;
                oHistoryList.Setup(PrimaryEntity, TabParentStructureId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
예제 #2
0
        public override int?Save(string action)
        {
            var data = new TabParentStructureDataModel();

            data.TabParentStructureId = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;
            data.IsAllTab    = IsAllTab;

            if (action == "Insert")
            {
                var dtTabParentStructure = TabParentStructureDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtTabParentStructure.Rows.Count == 0)
                {
                    TabParentStructureDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TabParentStructureDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.TabParentStructureId);
        }
예제 #3
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                var notDeletableIds = new List <int>();
                var deleteIndexList = DeleteIds.Split(',');

                foreach (var index in deleteIndexList)
                {
                    var data = new TabParentStructureDataModel();
                    data.TabParentStructureId = int.Parse(index);

                    if (!TabParentStructureDataManager.IsDeletable(data, SessionVariables.RequestProfile))
                    {
                        notDeletableIds.Add((int)(data.TabParentStructureId));
                    }
                }

                if (notDeletableIds.Count == 0)
                {
                    foreach (var index in deleteIndexList)
                    {
                        var data = new TabParentStructureDataModel();
                        data.TabParentStructureId = int.Parse(index);

                        TabParentStructureDataManager.Delete(data, SessionVariables.RequestProfile);
                    }
                }
                else
                {
                    var msg = String.Empty;

                    foreach (var id in notDeletableIds)
                    {
                        if (!string.IsNullOrEmpty(msg))
                        {
                            msg += ", <br/>";
                        }
                        msg += "TabParentStructureId: " + id + " has detail records";
                    }

                    foreach (string index in deleteIndexList)
                    {
                        var data = new TabParentStructureDataModel();
                        data.TabParentStructureId = int.Parse(index);

                        TabParentStructureDataManager.DeleteChildren(data, SessionVariables.RequestProfile);
                        TabParentStructureDataManager.Delete(data, SessionVariables.RequestProfile);
                    }
                }

                DeleteAndRedirect();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
예제 #4
0
        protected override DataTable GetData()
        {
            var dt = TabParentStructureDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }
예제 #5
0
        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);
            }
        }