Ejemplo n.º 1
0
        public async Task <ViewBagModel> ViewBagLoad(string Controller, string Action, string token, string EnvironmentName, IConfiguration configuration, bool IsReadLogIntRecord, int ReadLogIntRecord = 0, string ReadLogStringRecord = "")
        {
            ViewBagModel ViewBagSet = new ViewBagModel();

            ViewBagSet.UITerms = await _client.GetProtectedAsync <List <UITermLanguageCustomizationList> >($"{configuration["APIUrl"]}api/MVC/{Controller}/{Action}", token);

            ViewBagSet.Favorites = await _client.GetProtectedAsync <List <MVCFavoriteMenu> >($"{configuration["APIUrl"]}api/MVCFavorite/Menu", token);

            ViewBagSet.FavoriteGroupList = await _client.GetProtectedAsync <List <MVCFavoriteGroupList> >($"{configuration["APIUrl"]}api/MVCFavorite/GroupList", token);

            ViewBagSet.Env           = EnvironmentName;
            ViewBagSet.MVCUIScreenId = await _client.GetProtectedAsync <string>($"{configuration["APIUrl"]}api/MVCUIScreen/ScreenId?Controller={Controller}&Action={Action}", token);

            var ErrorMessage      = new List <ErrorMessage>();
            var ReadLogGetGrid    = new List <ReadLogGet>();
            var ChangeLogGetGrid  = new List <ChangeLogGet>();
            var ReadLogParameters = new LogParameters()
            {
                ActionName = Action, ControllerName = Controller, IsIntRecordId = IsReadLogIntRecord, IntRecordId = ReadLogIntRecord, StringRecordId = ReadLogStringRecord
            };

            ReadLogGetGrid = await _client.PostProtectedAsync <List <ReadLogGet> >($"{configuration["APIUrl"]}api/Log/ReadLogView", ReadLogParameters, token);

            ChangeLogGetGrid = await _client.PostProtectedAsync <List <ChangeLogGet> >($"{configuration["APIUrl"]}api/Log/ChangeLogView", ReadLogParameters, token);

            ViewBagSet.ReadLogGetGrid   = ReadLogGetGrid;
            ViewBagSet.ChangeLogGetGrid = ChangeLogGetGrid;
            ViewBagSet.ErrorMessages    = ErrorMessage;
            return(ViewBagSet);
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            try
            {
                if (HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik") == null)
                {
                    return(View("~/Views/Login/Index.cshtml"));
                }

                ViewBagModel      viewBag      = new ViewBagModel();
                GlavnaMasterModel glavnaMaster = GlavnaDAO.CreateNewMasterGlavna(HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik"));
                HttpContext.Session.SetInt32("GlavnaMasterID", glavnaMaster.AutoID);
                glavnaMaster.Uvoznik.Naziv     = HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik").Uvoznik.Naziv;
                glavnaMaster.DatumKreiranjaUTC = DateTime.Now;
                viewBag.GlavnaMaster           = glavnaMaster;
                //AtributSetModel  atributSet = new AtributSetModel();
                //atributSet.Atributi.Add(new AtributModel { Naziv = "Vrsta upotrebe" });
                //atributSet.Atributi.Add(new AtributModel { Naziv = "Radijus" });
                //viewBag.Glavna.VrstaHomologacije.AtributSet = atributSet;
                //ViewBag.Message = "Obračun računa se vrši 1-og u mjesecu za unešene zahtjeve iz prethodnog mjeseca.";
                return(View(viewBag));
            }
            catch (Exception)
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        public ActionResult CreateAttr()
        {
            if (HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik") == null)
            {
                return(View("~/Views/Login/Index.cshtml"));
            }

            ViewBagModel      viewBag      = new ViewBagModel();
            GlavnaMasterModel glavnaMaster = GlavnaDAO.GetMasterObjectById(Convert.ToInt32(HttpContext.Session.GetInt32("GlavnaMasterID")));

            viewBag.GlavnaMaster = glavnaMaster;
            viewBag.Glavna.VrstaHomologacije.AtributSet = VrsteHomologacijeDAO.GetAtributSet(VrstaHomologacijeID);
            viewBag.AtributSet = viewBag.Glavna.VrstaHomologacije.AtributSet; // Test Stavio Atribut Set u View Bag Model
            return(View("Create", viewBag));
        }
Ejemplo n.º 4
0
        public ActionResult SaveAttributes(AtributSetModel model)
        {
            try
            {
                if (HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik") == null)
                {
                    return(View("~/Views/Login/Index.cshtml"));
                }
            }
            catch (Exception e)
            {
                e.StackTrace.ToString();
            }
            ViewBagModel      viewBag      = new ViewBagModel();
            GlavnaMasterModel glavnaMaster = GlavnaDAO.GetMasterObjectById(Convert.ToInt32(HttpContext.Session.GetInt32("GlavnaMasterID")));

            viewBag.GlavnaMaster = glavnaMaster;
            return(View("Create", viewBag));
        }
Ejemplo n.º 5
0
        //public IActionResult FileSystem(FileSystemCommand command, string arguments)
        //{
        //    //var config = new FileSystemConfiguration
        //    //{
        //    //    Request = Request,
        //    //    FileSystemProvider = new DefaultFileProvider(CreateGlavnaMasterFolder()),
        //    //    //AllowCopy = true,
        //    //    //AllowCreate = true,
        //    //    //AllowMove = true,
        //    //    AllowRemove = true,
        //    //    AllowRename = true,
        //    //    AllowUpload = true
        //    //};
        //    dynamic jsonObject = JObject.Parse(arguments);
        //    int? parentid = jsonObject.destinationId;
        //    if (parentid != null)
        //        if (GlavnaDAO.CheckRASGlavna(parentid, HttpContext.Session.GetObjectFromJson<KorisnikModel>("LogovaniKorisnik").Uvoznik.AutoID))
        //        {
        //            if (command == FileSystemCommand.UploadChunk)
        //            {
        //                return BadRequest("Ne možete uploadovati dokumente za trenutni status predmeta!");
        //            }
        //        }
        //    //var processor = new FileSystemCommandProcessor(config);
        //    //var result = processor.Execute(command, arguments);
        //    return Ok(result.GetClientCommandResult());
        //}

        //[HttpPost]
        //public ActionResult UploadFile()
        //{
        //    var myFile = Request.Files["myFile"];
        //    var targetLocation = Server.MapPath("~/Content/Files/");
        //    var uniqueFileName = string.Format("{0}_{1}{2}",
        //        Path.GetFileNameWithoutExtension(myFile.FileName),
        //        Request["key"],
        //        Path.GetExtension(myFile.FileName));

        //    try
        //    {
        //        var path = Path.Combine(targetLocation, uniqueFileName);
        //        myFile.SaveAs(path);
        //        Session["currentFilePath"] = path;
        //    }
        //    catch
        //    {
        //        Response.StatusCode = 400;
        //    }

        //    return new EmptyResult();
        //}

        //public ActionResult Edit()
        //{
        //    if (KorisnikModel.LogovanKorisnik.Uvoznik.AutoID == 0)
        //    {
        //        return View("~/Views/Login/Index.cshtml");
        //    }

        //    if (KorisnikModel.LogovanKorisnik.Uvoznik.AutoID == 0)
        //    {
        //        return View("~/Views/Login/Index.cshtml");
        //    }

        //    ViewBagModel viewBag = new ViewBagModel();
        //    GlavnaMasterModel glavnaMaster = GlavnaDAO.GetMasterObjectById(GlavnaMasterAutoID);
        //    viewBag.GlavnaMaster = glavnaMaster;
        //    ViewBag.Message = "Obračun računa se vrši 1-og u mjesecu za unešene zahtjeve iz prethodnog mjeseca.";
        //    return View("Create", viewBag);
        //}


        public ActionResult Edit()
        {
            ViewBagModel viewBag = new ViewBagModel();

            //ViewBag.Message = "Obračun računa se vrši 1-og u mjesecu za unešene zahtjeve iz prethodnog mjeseca.";
            try
            {
                if (HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik") == null)
                {
                    return(View("~/Views/Login/Index.cshtml"));
                }
                GlavnaMasterModel glavnaMaster = GlavnaDAO.GetMasterObjectByUvoznikId(HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik").Uvoznik.AutoID);
                viewBag.GlavnaMaster = glavnaMaster;
                HttpContext.Session.SetInt32("GlavnaMasterID", glavnaMaster.AutoID);
                //HttpContext.Session.SetString("ApprovalFilePath", Path.Combine(IocContainer.Configuration["DocumentsPath"], glavnaMaster.DatumKreiranjaUTC.Year.ToString(), GetMonth(glavnaMaster.DatumKreiranjaUTC), glavna.GlavnaMaster.AutoID.ToString(), glavna.AutoID.ToString()));
            } catch (Exception e)
            {
                return(View("Create"));
            }
            return(View("Create", viewBag));
        }