Exemplo n.º 1
0
        public IActionResult Record(x31RecordViewModel v, string oper)
        {
            RefreshState(v);
            if (oper == "postback")
            {
                return(View(v));
            }
            if (ModelState.IsValid)
            {
                BO.x31Report c = new BO.x31Report();
                if (v.Rec.pid > 0)
                {
                    c = Factory.x31ReportBL.Load(v.Rec.pid);
                }
                var lisO27 = BO.BASFILE.GetUploadedFiles(Factory.App.TempFolder, v.UploadGuid);
                if (lisO27.Count() > 0)
                {
                    c.x31FileName = lisO27.First().o27Name;
                }
                c.x31Entity          = v.Rec.x31Entity;
                c.x31Name            = v.Rec.x31Name;
                c.x31Code            = v.Rec.x31Code;
                c.x31Description     = v.Rec.x31Description;
                c.x31Is4SingleRecord = v.Rec.x31Is4SingleRecord;
                c.x31ReportFormat    = v.Rec.x31ReportFormat;
                c.ValidUntil         = v.Toolbar.GetValidUntil(c);
                c.ValidFrom          = v.Toolbar.GetValidFrom(c);

                c.pid = Factory.x31ReportBL.Save(c);
                if (c.pid > 0)
                {
                    if (lisO27.Count() > 0)
                    {
                        System.IO.File.Copy(Factory.App.TempFolder + "\\" + lisO27.First().o27ArchiveFileName, Factory.App.ReportFolder + "\\" + lisO27.First().o27Name, true);
                    }
                    v.SetJavascript_CallOnLoad(c.pid);
                    return(View(v));
                }
            }
            this.Notify_RecNotSaved();
            return(View(v));
        }
Exemplo n.º 2
0
 private void RefreshState(x31RecordViewModel v)
 {
     v.Toolbar = new MyToolbarViewModel(v.Rec);
 }