Exemple #1
0
        public IActionResult ReportContext(ReportContextViewModel v, string oper)
        {
            RefreshStateReportContext(v);

            if (oper == "change_x31id" && v.SelectedX31ID > 0)
            {
                Factory.CBL.SetUserParam(v.UserParamKey, v.SelectedX31ID.ToString());
                v.GeneratedTempFileName = "";
            }


            return(View(v));
        }
Exemple #2
0
        private void RefreshStateReportContext(ReportContextViewModel v)
        {
            v.Prefix = v.rec_prefix;
            if (v.SelectedX31ID > 0)
            {
                v.RecX31         = Factory.x31ReportBL.Load(v.SelectedX31ID);
                v.SelectedReport = v.RecX31.x31Name;

                if (!System.IO.File.Exists(Factory.App.ReportFolder + "\\" + v.RecX31.x31FileName))
                {
                    this.AddMessage("Na serveru nelze dohledat soubor šablony zvolené tiskové sestavy.");
                }
            }
        }
Exemple #3
0
        public IActionResult ReportContext(int pid, string prefix, int x31id)
        {
            var v = new ReportContextViewModel()
            {
                rec_pid = pid, rec_prefix = prefix
            };

            if (string.IsNullOrEmpty(v.rec_prefix) == true || v.rec_pid == 0)
            {
                return(StopPage(true, "pid or prefix missing"));
            }
            if (x31id == 0)
            {
                v.UserParamKey = "ReportContext-" + prefix + "-x31id";
                x31id          = Factory.CBL.LoadUserParamInt(v.UserParamKey);
            }
            v.SelectedX31ID = x31id;


            RefreshStateReportContext(v);
            return(View(v));
        }