public void InitializeControls( )
        {
            GridCtrl = new ABCGridControl();
            GridCtrl.Initialize(TableName);
            ABCGridColumn col = new ABCGridColumn();

            col.FieldName                     = ABCCommon.ABCConstString.colSelected;
            col.Caption                       = "Chọn";
            col.TableName                     = TableName;
            col.VisibleIndex                  = 0;
            col.Visible                       = true;
            col.Width                         = 20;
            col.OptionsColumn.AllowEdit       = true;
            col.FilterMode                    = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
            col.OptionsFilter.AllowAutoFilter = true;
            col.ColumnEdit                    = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
            GridCtrl.GridDefaultView.Columns.Insert(0, col);


            GridCtrl.Dock              = System.Windows.Forms.DockStyle.Fill;
            GridCtrl.Parent            = this;
            GridCtrl.ShowSaveButton    = false;
            GridCtrl.ShowDeleteButton  = false;
            GridCtrl.ShowRefreshButton = false;
            GridCtrl.EnableFocusedCell = false;
            GridCtrl.FocusRectStyle    = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            GridCtrl.BringToFront();

            this.Shown        += new EventHandler(ABCSelectionView_Shown);
            this.ShowInTaskbar = false;

            this.Text = "Danh sách " + DataConfigProvider.GetTableCaption(TableName);
        }
Exemple #2
0
        private void UpdateLabelText( )
        {
            if (this.LayoutItem.Control == null)
            {
                return;
            }

            String strCaption = String.Empty;

            if (String.IsNullOrWhiteSpace(this.DataSource) == false && string.IsNullOrWhiteSpace(this.DataMember) == false)
            {
                strCaption = ABCPresentHelper.GetLabelCaption(OwnerView, this.DataSource, this.DataMember);
            }
            else
            {
                if (String.IsNullOrWhiteSpace(this.TableName) == false && string.IsNullOrWhiteSpace(this.DataMember) == false)
                {
                    strCaption = ABCPresentHelper.GetLabelCaption(this.TableName, this.DataMember);
                }
                else
                {
                    strCaption = DataConfigProvider.GetTableCaption(this.TableName);
                }
            }
            if (String.IsNullOrWhiteSpace(textLabel))
            {
                this.LayoutItem.Text = strCaption;
            }
            else
            {
                this.LayoutItem.Text = textLabel;
            }
        }
Exemple #3
0
        public void InitializeToolbar( )
        {
            if (this.Screen.DataManager.MainObject == null)
            {
                this.View.ShowRefreshItem   = false;
                this.View.ShowCancelItem    = false;
                this.View.ShowSaveItem      = false;
                this.View.ShowEditItem      = false;
                this.View.ShowDuplicateItem = false;
                this.View.ShowNewItem       = false;
                this.View.ShowDeleteItem    = false;
                this.View.ShowSearchItem    = false;
                this.View.ShowPostItem      = false;
                this.View.ShowApproveItem   = false;
                this.View.ShowLockItem      = false;
                this.View.ShowPrintItem     = false;
                this.View.ShowInfoItem      = false;
            }
            else
            {
                this.View.ShowSaveItem   = false;
                this.View.ShowCancelItem = false;
                this.View.ShowInfoItem   = true;
            }

            BackupToolbarStatus.ShowNewItem       = this.View.ShowNewItem;
            BackupToolbarStatus.ShowEditItem      = this.View.ShowEditItem;
            BackupToolbarStatus.ShowDuplicateItem = this.View.ShowDuplicateItem;
            BackupToolbarStatus.ShowDeleteItem    = this.View.ShowDeleteItem;
            BackupToolbarStatus.ShowSaveItem      = this.View.ShowSaveItem;
            BackupToolbarStatus.ShowCancelItem    = this.View.ShowCancelItem;

            SetToolBarButtonVisibility(ABCView.ScreenBarButton.New, this.View.ShowNewItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Duplicate, this.View.ShowDuplicateItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Edit, this.View.ShowEditItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Delete, this.View.ShowDeleteItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Approve, this.View.ShowApproveItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Reject, false);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Lock, this.View.ShowLockItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.UnLock, false);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Post, this.View.ShowPostItem);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.UnPost, false);
            SetToolBarButtonVisibility(ABCView.ScreenBarButton.Print, this.View.ShowPrintItem);

            if (this.Screen.DataManager.MainObject != null)
            {
                foreach (GERelationConfigsInfo config in VoucherProvider.GetRelationConfigs(this.Screen.DataManager.MainObject.TableName))
                {
                    AddNewToolbarButton("UtilitiesItem", String.Format("Tạo từ {0}", DataConfigProvider.GetTableCaption(config.SourceTableName)), config.GetID(), "NewFromRelation-" + config.SourceTableName, 46);
                    SetToolBarButtonVisibility(ABCView.ScreenBarButton.Utilities, true);
                }
            }

            this.View.ToolbarClickEvent += new ABCView.ABCToobarClickEventHandler(View_ToolbarClickEvent);
        }
        public ABCObjectInformation(ABCObjectInfo obj)
        {
            currentObject = obj;

            InitializeComponent();

            if (obj.ObjectID == Guid.Empty)
            {
                return;
            }

            txtObjectType.Text = DataConfigProvider.GetTableCaption(obj.TableName);
            txtObjectNo.Text   = obj.ObjectNo;

            this.Text = "Lịch sử " + txtObjectType.Text + " : " + txtObjectNo.Text;

            txtCreateUser.Text = obj.CreateUser;
            if (obj.CreateTime.HasValue)
            {
                txtCreateTime.Text = obj.CreateTime.Value.ToString("dd/MM/yyyy HH:mm");
            }
            else
            {
                txtCreateTime.Text = "";
            }

            txtUpdateUser.Text = obj.UpdateUser;
            if (obj.UpdateTime.HasValue)
            {
                txtUpdateTime.Text = obj.UpdateTime.Value.ToString("dd/MM/yyyy HH:mm");
            }
            else
            {
                txtUpdateTime.Text = "";
            }

            txtEditCount.Text = obj.EditCount.ToString();

            ABCComment comment = new ABCComment();

            comment.Dock = DockStyle.Fill;
            comment.LoadComments(obj.TableName, obj.ObjectID);
            xtraTabPage1.Controls.Add(comment);

            ABCLogging logging = new ABCLogging();

            logging.Dock = DockStyle.Fill;
            logging.LoadLogs(obj.TableName, obj.ObjectID);
            xtraTabPage2.Controls.Add(logging);
        }
        public void InitializeControls( )
        {
            //SearchPanel=new ABCAutoSearchPanel();
            //SearchPanel.PopulateControls( BindingObject.TableName );
            //SearchPanel.Dock=System.Windows.Forms.DockStyle.Top;
            //this.Width=SearchPanel.Width+30;

            //SearchPanel.Parent=this;
            //SearchPanel.Search+=new ABCSearchPanel.ABCSearchEventHandler( SearchPanel_Search );

            GridCtrl = new ABCGridControl();
            GridCtrl.Initialize(BindingObject.TableName);

            binding = new BindingSource();
            GridCtrl.GridDataSource = binding;
            GridCtrl.RefreshDataSource();

            if (DataStructureProvider.IsTableColumn(BindingObject.TableName, ABCCommon.ABCConstString.colEditCount))
            {
                if (GridCtrl.GridDefaultView.Columns.ColumnByFieldName(ABCCommon.ABCConstString.colEditCount) == null)
                {
                    ABCGridColumn col = new ABCGridColumn();
                    col.FieldName                     = ABCCommon.ABCConstString.colEditCount;
                    col.Caption                       = "Hiệu chỉnh";
                    col.TableName                     = BindingObject.TableName;
                    col.VisibleIndex                  = GridCtrl.GridDefaultView.Columns.Count - 1;
                    col.Visible                       = true;
                    col.Width                         = 20;
                    col.OptionsColumn.AllowEdit       = false;
                    col.FilterMode                    = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
                    col.OptionsFilter.AllowAutoFilter = true;
                    GridCtrl.GridDefaultView.Columns.Insert(GridCtrl.GridDefaultView.Columns.Count - 1, col);
                }
                //if ( GridCtrl.GridDefaultView.Columns.ColumnByFieldName( ABCCommon.ABCConstString.colSelected )==null )
                //{
                //    ABCGridColumn col=new ABCGridColumn();
                //    col.FieldName=ABCCommon.ABCConstString.colSelected;
                //    col.Caption="Chọn";
                //    col.TableName=BindingObject.TableName;
                //    col.VisibleIndex=0;
                //    col.Visible=true;
                //    col.Width=20;
                //    col.OptionsColumn.AllowEdit=true;
                //    col.FilterMode=DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
                //    col.OptionsFilter.AllowAutoFilter=true;
                //    col.ColumnEdit=new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
                //    GridCtrl.GridDefaultView.Columns.Add( col );
                //}
            }


            GridCtrl.Dock                         = System.Windows.Forms.DockStyle.Fill;
            GridCtrl.Parent                       = this;
            GridCtrl.ShowSaveButton               = false;
            GridCtrl.ShowDeleteButton             = false;
            GridCtrl.ShowRefreshButton            = false;
            GridCtrl.EnableFocusedCell            = false;
            GridCtrl.FocusRectStyle               = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            GridCtrl.GridDefaultView.DoubleClick += new EventHandler(GridDefaultView_DoubleClick);
            GridCtrl.GridDefaultView.MouseUp     += new System.Windows.Forms.MouseEventHandler(GridDefaultView_MouseUp);
            GridCtrl.BringToFront();

            this.Height = 400;
            this.Width  = 700;
            if (BindingObject.DataManager.Screen.ViewForm != null)
            {
                this.Location = new Point(BindingObject.DataManager.Screen.ViewForm.Left - this.Width, BindingObject.DataManager.Screen.ViewForm.Top);
                this.Height   = BindingObject.DataManager.Screen.ViewForm.Height;
                BindingObject.DataManager.Screen.ViewForm.LocationChanged += new EventHandler(ABCSearchView_LocationChanged);
                BindingObject.DataManager.Screen.ViewForm.SizeChanged     += new EventHandler(ABCSearchView_SizeChanged);
                this.Width = 300;
            }
            this.Shown       += new EventHandler(ABCSearchView_Shown);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(ABCSearchView_FormClosing);

            this.ShowInTaskbar = false;

            this.Text = "Danh sách " + DataConfigProvider.GetTableCaption(BindingObject.TableName);

            chkNotYetApproved.Visible         = DataStructureProvider.IsTableColumn(BindingObject.TableName, ABCCommon.ABCConstString.colApprovalStatus);
            chkLocked.Visible                 = DataStructureProvider.IsTableColumn(BindingObject.TableName, ABCCommon.ABCConstString.colLockStatus);
            chkNotYetPosted.Visible           = DataStructureProvider.IsTableColumn(BindingObject.TableName, ABCCommon.ABCConstString.colJournalStatus);
            chkNotYetApproved.Checked         = false;
            chkLocked.Checked                 = false;
            chkNotYetPosted.Checked           = false;
            chkNotYetApproved.CheckedChanged += new EventHandler(chk_CheckedChanged);
            chkLocked.CheckedChanged         += new EventHandler(chk_CheckedChanged);
            chkNotYetPosted.CheckedChanged   += new EventHandler(chk_CheckedChanged);
            this.StartPosition                = FormStartPosition.CenterParent;

            //   SearchPanel_Search( null );
        }
Exemple #6
0
        public void InitializeControls( )
        {
            if (RelationConfig == null)
            {
                return;
            }

            if (RelationConfig.IsFromSource)
            {
                #region MainObject
                MainGridCtrl = new ABCGridControl();
                MainGridCtrl.Initialize(RelationConfig.SourceTableName);
                bindingMain = new BindingSource();
                MainGridCtrl.GridDataSource = bindingMain;
                MainGridCtrl.RefreshDataSource();

                ABCGridColumn col = new ABCGridColumn();
                col.FieldName                     = ABCCommon.ABCConstString.colSelected;
                col.Caption                       = "Chọn";
                col.TableName                     = RelationConfig.SourceTableName;
                col.VisibleIndex                  = 0;
                col.Visible                       = true;
                col.Width                         = 20;
                col.OptionsColumn.AllowEdit       = true;
                col.FilterMode                    = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
                col.OptionsFilter.AllowAutoFilter = true;
                col.ColumnEdit                    = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
                MainGridCtrl.GridDefaultView.Columns.Insert(0, col);

                MainGridCtrl.Dock              = System.Windows.Forms.DockStyle.Fill;
                MainGridCtrl.Parent            = mainTab;
                MainGridCtrl.ShowSaveButton    = false;
                MainGridCtrl.ShowDeleteButton  = false;
                MainGridCtrl.ShowRefreshButton = false;
                MainGridCtrl.EnableFocusedCell = false;
                MainGridCtrl.FocusRectStyle    = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
                MainGridCtrl.BringToFront();

                mainTab.Text = " Chọn " + DataConfigProvider.GetTableCaption(RelationConfig.SourceTableName);

                #endregion
            }
            if (RelationConfig.IsFromSourceItem)
            {
                #region ItemObject
                ItemGridCtrl = new ABCGridControl();
                ItemGridCtrl.Initialize(RelationConfig.SourceItemTableName);
                bindingItem = new BindingSource();
                ItemGridCtrl.GridDataSource = bindingItem;
                ItemGridCtrl.RefreshDataSource();

                ABCGridColumn col = new ABCGridColumn();
                col.FieldName                     = ABCCommon.ABCConstString.colSelected;
                col.Caption                       = "Chọn";
                col.TableName                     = RelationConfig.SourceItemTableName;
                col.VisibleIndex                  = 0;
                col.Visible                       = true;
                col.Width                         = 20;
                col.OptionsColumn.AllowEdit       = true;
                col.FilterMode                    = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
                col.OptionsFilter.AllowAutoFilter = true;
                col.ColumnEdit                    = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
                ItemGridCtrl.GridDefaultView.Columns.Insert(0, col);

                ItemGridCtrl.Dock              = System.Windows.Forms.DockStyle.Fill;
                ItemGridCtrl.Parent            = itemTab;
                ItemGridCtrl.ShowSaveButton    = false;
                ItemGridCtrl.ShowDeleteButton  = false;
                ItemGridCtrl.ShowRefreshButton = false;
                ItemGridCtrl.EnableFocusedCell = false;
                ItemGridCtrl.FocusRectStyle    = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
                ItemGridCtrl.BringToFront();

                itemTab.Text = " Chọn " + DataConfigProvider.GetTableCaption(RelationConfig.SourceItemTableName);


                #endregion
            }

            this.Shown        += new EventHandler(ABCRelationChooser_Shown);
            this.ShowInTaskbar = false;
            this.StartPosition = FormStartPosition.CenterParent;

            this.Text = String.Format("Tạo {0} từ {1}", DataConfigProvider.GetTableCaption(RelationConfig.DestinyTableName), DataConfigProvider.GetTableCaption(RelationConfig.SourceTableName));
        }
        private void InitTable(ABCCommonTreeListNode parentNode, ABCScreen.ABCBindingConfig bindInfo)
        {
            if (DataStructureProvider.DataTablesList.ContainsKey(bindInfo.TableName) == false)
            {
                return;
            }

            ABCCommonTreeListNode node      = null;
            FieldNodeInfo         fieldInfo = new FieldNodeInfo();

            fieldInfo.Display = DataConfigProvider.GetTableCaption(bindInfo.TableName) + String.Format(@" ( {0} ) ", bindInfo.Name);
            fieldInfo.Type    = FiledNodeType.List;
            fieldInfo.Config  = bindInfo;
            node = new ABCCommonTreeListNode(parentNode, fieldInfo);

            InitControl(node, typeof(ABCSearchPanel), "SearchPanel");
            InitControl(node, typeof(ABCAutoSearchPanel), "AutoSearchPanel");
            InitControl(node, typeof(ABCDataPanel), "DataPanel");
            if (bindInfo.IsList)
            {
                fieldInfo.Type = FiledNodeType.List;

                #region IsList

                #region Grid
                fieldInfo                               = new FieldNodeInfo();
                fieldInfo.Type                          = FiledNodeType.Control;
                fieldInfo.Display                       = "GridControl";
                fieldInfo.ToolboxItem                   = new ABCToolboxItem(typeof(ABCGridControl));
                fieldInfo.ToolboxItem.Binding           = new ABCControls.ABCBindingInfo();
                fieldInfo.ToolboxItem.Binding.BusName   = bindInfo.Name;
                fieldInfo.ToolboxItem.Binding.TableName = bindInfo.TableName;
                ABCCommonTreeListNode listNode = new ABCCommonTreeListNode(node, fieldInfo);
                #endregion

                #region BandedGrid
                fieldInfo                               = new FieldNodeInfo();
                fieldInfo.Type                          = FiledNodeType.Control;
                fieldInfo.Display                       = "BandedGridControl";
                fieldInfo.ToolboxItem                   = new ABCToolboxItem(typeof(ABCGridBandedControl));
                fieldInfo.ToolboxItem.Binding           = new ABCControls.ABCBindingInfo();
                fieldInfo.ToolboxItem.Binding.BusName   = bindInfo.Name;
                fieldInfo.ToolboxItem.Binding.TableName = bindInfo.TableName;
                listNode = new ABCCommonTreeListNode(node, fieldInfo);
                #endregion

                #region BandedGrid
                fieldInfo                               = new FieldNodeInfo();
                fieldInfo.Type                          = FiledNodeType.Control;
                fieldInfo.Display                       = "PivotGridControl";
                fieldInfo.ToolboxItem                   = new ABCToolboxItem(typeof(ABCPivotGridControl));
                fieldInfo.ToolboxItem.Binding           = new ABCControls.ABCBindingInfo();
                fieldInfo.ToolboxItem.Binding.BusName   = bindInfo.Name;
                fieldInfo.ToolboxItem.Binding.TableName = bindInfo.TableName;
                listNode = new ABCCommonTreeListNode(node, fieldInfo);
                #endregion

                #region BandedGrid
                fieldInfo                               = new FieldNodeInfo();
                fieldInfo.Type                          = FiledNodeType.Control;
                fieldInfo.Display                       = "TreeList";
                fieldInfo.ToolboxItem                   = new ABCToolboxItem(typeof(ABCTreeList));
                fieldInfo.ToolboxItem.Binding           = new ABCControls.ABCBindingInfo();
                fieldInfo.ToolboxItem.Binding.BusName   = bindInfo.Name;
                fieldInfo.ToolboxItem.Binding.TableName = bindInfo.TableName;
                listNode = new ABCCommonTreeListNode(node, fieldInfo);
                #endregion
                #endregion
            }
            else
            {
                fieldInfo.Type = FiledNodeType.Table;
            }

            foreach (String strFieldName in DataStructureProvider.DataTablesList[bindInfo.TableName].ColumnsList.Keys)
            {
                InitField(node, bindInfo.TableName, strFieldName);
            }


            foreach (ABCScreen.ABCBindingConfig childInfo in bindInfo.Children.Values)
            {
                InitTable(node, childInfo);
            }
        }