Beispiel #1
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            using (new SessionScope(MetaManagerServices.GetSessionFactory(), MetaManagerServices.GetDomainInterceptor(), true, FlushMode.Never, true))
            {
                FindViewTypes findViewType = FindViewTypes.All;

                if (rbCustomOnly.Checked)
                {
                    findViewType = FindViewTypes.Custom;
                }
                else if (rbDrilldowns.Checked)
                {
                    findViewType = FindViewTypes.Drilldowns;
                }

                // Find the views
                IList <Cdc.MetaManager.DataAccess.Domain.View> views = dialogService.GetViews(tbEntity.Text, tbName.Text, tbTitle.Text, findViewType, FrontendApplication.Id);

                lvResult.BeginUpdate();

                lvResult.Items.Clear();

                if (views != null && views.Count > 0)
                {
                    foreach (Cdc.MetaManager.DataAccess.Domain.View view in views)
                    {
                        ListViewItem item = lvResult.Items.Add(view.Id.ToString());
                        item.SubItems.Add(view.Name);
                        item.SubItems.Add(view.Title);
                        item.SubItems.Add(view.Type.ToString());
                        item.SubItems.Add(view.BusinessEntity.Name);
                        item.Tag = view;
                    }
                }

                lvResult.EndUpdate();
            }

            EnableDisableButtons();
        }
 public IList <View> GetViews(string entityName, string viewName, string title, FindViewTypes findViewTypes, Guid applicationId)
 {
     return(ViewDao.FindViews(entityName, viewName, title, findViewTypes, applicationId));
 }
Beispiel #3
0
        public IList <View> FindViews(string entityName, string viewName, string title, FindViewTypes findViewTypes, Guid applicationId)
        {
            if (string.IsNullOrEmpty(entityName))
            {
                entityName = "%";
            }

            if (string.IsNullOrEmpty(viewName))
            {
                viewName = "%";
            }

            if (string.IsNullOrEmpty(title))
            {
                title = "%";
            }

            if (findViewTypes == FindViewTypes.All)
            {
                string[] paramNames  = { "entityName", "viewName", "title", "applicationId" };
                object[] paramValues = { entityName, viewName, title, applicationId };

                return(HibernateTemplate.FindByNamedQueryAndNamedParam <View>("View.FindView", paramNames, paramValues));
            }
            else if (findViewTypes == FindViewTypes.Custom)
            {
                string[] paramNames  = { "entityName", "viewName", "title", "applicationId" };
                object[] paramValues = { entityName, viewName, title, applicationId };

                return(HibernateTemplate.FindByNamedQueryAndNamedParam <View>("View.FindViewCustom", paramNames, paramValues));
            }
            else if (findViewTypes == FindViewTypes.Drilldowns)
            {
                string[] paramNames  = { "entityName", "viewName", "title", "applicationId", "dialogType" };
                object[] paramValues = { entityName, viewName, title, applicationId, (int)DialogType.Drilldown };

                return(HibernateTemplate.FindByNamedQueryAndNamedParam <View>("View.FindViewOverviews", paramNames, paramValues));
            }
            return(null);
        }