54 lines
1.9 KiB
C#
54 lines
1.9 KiB
C#
using DevExpress.Data.Filtering;
|
|
using DevExpress.ExpressApp;
|
|
using DevExpress.ExpressApp.Actions;
|
|
using DevExpress.ExpressApp.Editors;
|
|
using DevExpress.ExpressApp.Layout;
|
|
using DevExpress.ExpressApp.Model.NodeGenerators;
|
|
using DevExpress.ExpressApp.Security;
|
|
using DevExpress.ExpressApp.SystemModule;
|
|
using DevExpress.ExpressApp.Templates;
|
|
using DevExpress.ExpressApp.Updating;
|
|
using DevExpress.ExpressApp.Utils;
|
|
using DevExpress.Persistent.Base;
|
|
using DevExpress.Persistent.Validation;
|
|
using DurnyklyYol.Module.BusinessObjects;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace DurnyklyYol.Module.Controllers
|
|
{
|
|
// For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppViewControllertopic.aspx.
|
|
public partial class GoodsController : ObjectViewController<ListView, Goods>
|
|
{
|
|
public GoodsController()
|
|
{
|
|
InitializeComponent();
|
|
// Target required Views (via the TargetXXX properties) and create their Actions.
|
|
}
|
|
protected override void OnActivated()
|
|
{
|
|
base.OnActivated();
|
|
|
|
if (View is ListView listView)
|
|
{
|
|
if (IsCurrentUserInRoleOperator.IsCurrentUserInRole(GlobalConstants.ClientRoleName))
|
|
{
|
|
listView.CollectionSource.Criteria["Filter1"] = CriteriaOperator.Parse("Client.Oid=CurrentUserId()");
|
|
}
|
|
}
|
|
|
|
//var gridListEditor = View.Editor as DevExpress.ExpressApp.Win.Editors.GridListEditor;
|
|
//if (gridListEditor != null)
|
|
//{
|
|
// var gridView = gridListEditor.GridView;
|
|
// gridView.Columns["Country"].GroupIndex = 0;
|
|
// gridView.Columns["City"].GroupIndex = 1;
|
|
// gridView.Columns["Company"].GroupIndex = 2;
|
|
//}
|
|
}
|
|
|
|
}
|
|
}
|