Ejemplo n.º 1
0
        public ActionResult Edit(CredSetupModel cvm)
        {
            //if (ModelState.IsValid)
            //{
            var cred = new CredentialSetup
            {
                ServerUsername = cvm.ServerUsername,
                ServerPassword = cvm.ServerPassword,
                HostUsername   = cvm.HostUsername,
                HostPassword   = cvm.HostPassword,
                InventoryId    = cvm.InventoryId,
                HostId         = cvm.HostId,
                Date           = cvm.Date


                                 //Locations = uvm.Locations
            };

            if (TryUpdateModel(cred))
            {
                _cred.Edit(cred);
                _cred.SaveChanges();
                TempData["Success"] = "Edited Successfully!";
                return(RedirectToAction("Index"));
            }



            ViewBag.message = "Fill all parameters";
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            var Inventory = InventoryManager.GetAll().ToList();
            var Host      = hostManager.GetAll().ToList();



            CredSetupModel cred = new CredSetupModel
            {
                Hosts       = Host,
                Inventories = Inventory
            };

            return(View(cred));
        }
Ejemplo n.º 3
0
        public ActionResult Create(CredSetupModel cvm)
        {
            if (ModelState.IsValid)
            {
                var cred = new CredentialSetup
                {
                    ServerUsername = cvm.ServerUsername,
                    ServerPassword = cvm.ServerPassword,
                    HostUsername   = cvm.HostUsername,
                    HostPassword   = cvm.HostPassword,
                    InventoryId    = cvm.InventoryId,
                    HostId         = cvm.HostId,
                    Date           = cvm.Date

                                     //Locations = uvm.Locations
                };

                _cred.Add(cred);
                _cred.SaveChanges();
                TempData["Success"] = "Added Successfully!";

                return(RedirectToAction("Index"));
            }


            var Inventory = InventoryManager.GetAll().ToList();
            var Host      = hostManager.GetAll().ToList();

            CredSetupModel credModel = new CredSetupModel
            {
                Hosts       = Host,
                Inventories = Inventory
            };

            return(View(credModel));
        }