Пример #1
0
        public async Task <ActionResult> Edit([Bind(Include = "ClientId,ClientName")] Client client)
        {
            if (ModelState.IsValid)
            {
                db.Entry(client).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(client));
        }
Пример #2
0
        public async Task <ActionResult> Edit([Bind(Include = "ClientCommandId,ClientId,Command,IsScheduled")] ClientCommand clientcommand)
        {
            if (ModelState.IsValid)
            {
                db.Entry(clientcommand).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new{ clientId = clientcommand.ClientId }));
            }
            return(View(clientcommand));
        }
        public async Task <ActionResult> Edit([Bind(Include = "ClientCommandLogId,LogType,LogText,ClientCommandId")] OutputLogViewModel output)
        {
            if (ModelState.IsValid)
            {
                var clientcommandlog = JsonConvert.DeserializeObject <ClientCommandLog>(JsonConvert.SerializeObject(output));
                db.Entry(clientcommandlog).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { clientCommandId = clientcommandlog.ClientCommandId }));
            }
            return(View(output));
        }