Esempio n. 1
0
        public ActionResult AddVersion(VersionsViewModel versionsViewModel)
        {
            versionsViewModel.Version.LogDate = DateTime.Now;
            versionsViewModel.Version.Created = DateTime.Now;

            if (!ModelState.IsValid)
            {
                versionsViewModel.GetTemplateVersionsAndCompanies();
                return(View(versionsViewModel));
            }

            if (versionsViewModel.Version.DeletedBool)
            {
                versionsViewModel.Version.DeletedString = "A";
            }
            else
            {
                versionsViewModel.Version.DeletedString = "N";
            }

            if (versionsViewModel.Version.LogFlagBool)
            {
                versionsViewModel.Version.LogFlagString = "A";
            }
            else
            {
                versionsViewModel.Version.LogFlagString = "N";
            }

            long versionId = 0;

            TempData["result"] = versionsViewModel.AddVersion(versionsViewModel.Version, ref versionId);
            return(RedirectToAction("GetVersion", new { idVersion = versionId }));
        }
Esempio n. 2
0
        public ActionResult GetTemplateVersion(VersionsViewModel versionsViewModel)
        {
            if (versionsViewModel.TemplateVersionId == 0)
            {
                TempData["result"] = "Nebyl vybrán vzor";
                return(RedirectToAction("AddVersion"));
            }

            versionsViewModel.GetTemplateVersion(versionsViewModel.TemplateVersionId);
            versionsViewModel.GetTemplateVersionsAndCompanies();
            return(View("AddVersion", versionsViewModel));
        }