public ActionResult savevirtual() { //id: id, type: type,amount:amount, price: price, remark: remark,km:km int id = WebRequest.GetInt("id", 0); int forbom = WebRequest.GetInt("forbom", 0); float amount = WebRequest.GetFloat("amount", 0.0f); float price = WebRequest.GetFloat("price", 0.0f); string km = WebRequest.GetString("km"); string type = WebRequest.GetString("type"); int bom = 0; int loss = 0; if (type == "add") { bom = id; id = 0; } string remark = WebRequest.GetString("remark"); var r = bomService.SaveVirtual(type, id, bom, forbom, km, amount, price, remark); return(Json(r, JsonRequestBehavior.AllowGet)); }