public clsModule(string ModuleName, TreeListNode Node)
            {
                ModuleAccess GlobalMa = BaseSecurity.GetModuleAccess(ModuleName);

                Ma = new ModuleAccess(ModuleName,
                                      GlobalMa.FolderName, GlobalMa.FormSettingType);
                Ma.ListDataField = GlobalMa.ListDataField;

                this.Node = Node;
            }
Beispiel #2
0
            public clsModule(string ModuleName, TreeListNode Node)
            {
                ModuleAccess GlobalMa = BaseSecurity.GetModuleAccess(ModuleName);

                Ma = new ModuleAccess(ModuleName,
                                      GlobalMa.FolderName, GlobalMa.FormSettingType
                                      ?? typeof(frmSecurityDocument));
                Ma.ListDataField = GlobalMa.ListDataField;

                foreach (ModuleDataField mdf in Ma.ListDataField)
                {
                    ListKey.Add(mdf.DataFieldName, new List <string>());
                }

                this.Node = Node;
            }
        public void ShowForm2(EntityForm EntityForm,
                              string ReportName, string FreeFilter,
                              object TransStartDate, object TransEndDate,
                              object[] Parameters)
        {
            _ReportName = ReportName;
            _EntityForm = EntityForm;

            if (EntityForm.ModuleName.Length > 0 && BaseSecurity.CurrentLogin
                .CurrentRole.Length > 0)
            {
                ModuleAccess ma = BaseSecurity.GetModuleAccess(EntityForm.ModuleName);

                if (!ma.GetVariable <bool>(SecurityVarName.ReportDesignPrint, false))
                {
                    comboBoxEdit1.Properties.Buttons[2].Enabled = false;
                }
            }

            _Evaluator = BaseFactory.CreateInstance <Evaluator>();
            if (_ReportName.Contains("Laporan"))
            {
                Text = _ReportName;
            }
            else
            {
                Text = "Laporan " + _ReportName;
            }

            _FilterForm = BaseFactory.CreateInstance(
                _EntityForm.FilterFormType) as IFilterForm;
            if (_FilterForm == null)
            {
                XtraMessageBox.Show("Form Filter harus implement Interface IFilterForm !",
                                    "Error Filter", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                return;
            }
            _ShowViewForm = _FilterForm as IShowView;
            if (_ShowViewForm == null)
            {
                XtraMessageBox.Show("Form Filter harus implement Interface IShowView !",
                                    "Error Filter", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                return;
            }

            if (_EntityForm.FilterFormType == null || _FilterForm as ReportEntity != null)
            {
                splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel2;
            }
            else
            {
                XtraForm Frm = _FilterForm as XtraForm;
                if (Frm != null)
                {
                    InitFilterForm(Frm, xtraScrollableControl1,
                                   splitContainerControl1);
                }
                else
                {
                    QueryReportEntity(xtraScrollableControl1,
                                      splitContainerControl1);
                }
            }

            List <string> ListItems = DocPrintBrowseLayout
                                      .GetListLayout("F_" + _ReportName);

            if (ListItems.Count == 0)
            {
                if (re != null)
                {
                    Dictionary <string, object> Vars = new Dictionary <string, object>();
                    re.GetVariables(Vars);
                    SaveReportFromTemplateFolder("F_", ReportName,
                                                 ListItems, Vars);
                }
                else
                {
                    SaveReportFromTemplateFolder("F_", ReportName,
                                                 ListItems, _FilterForm != null ?
                                                 _FilterForm.FilterList : null);
                }
            }
            comboBoxEdit1.Properties.Items.AddRange(ListItems);

            string CurrBrowseLayoutId = string.Empty;
            bool   Tmp;

            DocDefault.GetDefaultLayout(_ReportName,
                                        out CurrBrowseLayoutId, out CurrPrintLayoutId, out Tmp);

            if (re != null)
            {
                ((IShowView)re).ShowView(Parameters);
            }
            else if (_ShowViewForm != null)
            {
                _ShowViewForm.ShowView(Parameters);
            }

            comboBoxEdit1.SelectedItem = CurrBrowseLayoutId;
            if (comboBoxEdit1.SelectedIndex < 0 && comboBoxEdit1.Properties.Items.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }
            else
            {
                comboBoxEdit1_SelectedIndexChanged(null, null);
            }
            sbTotal.Caption = "Total Halaman: " +
                              printControl1.PrintingSystem.Pages.Count;
            ribbonStatusBar1.Refresh();
            printControl1.PrintingSystem.AfterChange += new DevExpress.XtraPrinting.ChangeEventHandler(PrintingSystem_AfterChange);
            Show();
            printControl1.Focus();
        }