public JsonResult RetVrUnitario(int idProd) { string _valor="0"; var retvalor = new sgoficina.dboficinaEntities().PRODUTO.Find(idProd); if(retvalor!=null) { _valor = retvalor.PRO_VRVENDA.ToString(); } var ret = new object[]{new {vrunit = _valor}}; return Json(ret, JsonRequestBehavior.AllowGet); }
public JsonResult RetTotal(int idServico) { string _valor = "0"; var ret_valor = new sgoficina.dboficinaEntities().SERVICO_ITEM.Where(i => i.ITM_SERVICO_ID == idServico); if(ret_valor.Count()>0) { _valor = ret_valor.Sum(s => s.ITM_VR_TOTAL).Value.ToString(); } var ret = new object[] { new { vrtotal = _valor } }; return Json(ret, JsonRequestBehavior.AllowGet); }