Пример #1
0
        /// <summary>
        /// Load total amount design which could be set in AX
        /// </summary>
        private void LoadTotalAmountDesign()
        {
            LayoutData layoutData = new LayoutData(ApplicationSettings.Database.LocalConnection, ApplicationSettings.Database.DATAAREAID);
            string     layoutId   = layoutData.GetLayoutId(ApplicationSettings.Terminal.StoreId, ApplicationSettings.Terminal.TerminalId, ApplicationSettings.Terminal.TerminalOperator.OperatorId);

            using (DataTable layoutTable = layoutData.GetLayout(layoutId))
            {
                if (layoutTable.Rows.Count > 0)
                {
                    string layout = DBUtil.ToStr(layoutTable.Rows[0]["TOTALSLAYOUTXML"]);

                    if (!string.IsNullOrWhiteSpace(layout))
                    {
                        try
                        {
                            totalAmounts.SetLayout(Utility.GetStream(layout));
                            totalAmounts.HideHeader();
                            totalAmounts.Translate();
                        }
                        catch (Exception x)
                        {
                            ApplicationExceptionHandler.HandleException(x.Message, x);
                        }
                    }
                }
            }
        }