public JsonResult StatisticSubmit(int lotrinh, int kyghi) { BillDao db = new BillDao(); var result = new StatisticViewModel(); if (lotrinh == 0 && kyghi == 0) { result = db.StatisticAll(); } else if (lotrinh != 0 && kyghi == 0) { result = db.StatisticLT(lotrinh); } else if (lotrinh == 0 && kyghi != 0) { result = db.StatisticKG(kyghi); } else { result = db.StatisticLTKG(lotrinh, kyghi); } var data = new { lt_ten = result.lt_ten, k_ten = result.k_ten, soho = result.soho, sonuoc = result.sonuoc, tongtien = result.tongtien }; var j = Json(data, JsonRequestBehavior.AllowGet); return(j); }