Ejemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            var hostResponse = new HostManager(Wrapper).GetHost(id);

            if (hostResponse.HasError)
            {
                return(ErrorView(hostResponse.ErrorString));
            }

            var model = new EditHostModel
            {
                ID         = hostResponse.ObjectValue.ID,
                HostName   = hostResponse.ObjectValue.HostName,
                PortNumber = hostResponse.ObjectValue.PortNumber,
                AllowableDowntimeMinutes = hostResponse.ObjectValue.AllowableDowntimeMinutes,
                PortType = hostResponse.ObjectValue.PortType
            };

            return(View("Edit", model));
        }
Ejemplo n.º 2
0
        public ActionResult UpdateHost(EditHostModel model)
        {
            var response = new HostManager(Wrapper).UpdateHost(model.ID, model.HostName, model.PortNumber, model.AllowableDowntimeMinutes, model.PortType);

            return(response.HasError ? ErrorView(response.ErrorString) : Index());
        }