public ActionResult EditCypto(long id) { CyptoItemViewModel model = new CyptoItemViewModel(); model._MainObj = cms_db.GetObjCyptoItem(id); return(View(model)); }
public async Task <ActionResult> EditCypto(CyptoItemViewModel model) { if (ModelState.IsValid) { CyptoItem ObjCyptoItem = cms_db.GetObjCyptoItem(model.id); ObjCyptoItem.is_active = model.is_active; ObjCyptoItem.allow_update = model.allow_update; int rs = await cms_db.UpdateCypto(ObjCyptoItem); return(RedirectToAction("EditCypto", new { id = model.id })); } return(RedirectToAction("Index")); }