コード例 #1
0
        public JsonResult ListarMesa(int id)
        {
            ListaMesaOutDTO resp = new ListaMesaOutDTO();

            resp = _mesa.ListarMesa(id);
            return(Json(resp, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ListaMesaOutDTO ListarMesa(int estadoMesaId)
        {
            ListaMesaOutDTO response = new ListaMesaOutDTO();
            MesaOutDTO      mesa     = new MesaOutDTO();

            response.listaMesas = new List <MesaOutDTO>();
            _IResultlSetHelper.setDataSource(conectionString);
            var responseDTO = new ResponseDTO();

            string        packageName   = "pkg_iteracion_2";
            string        procedureName = "LISTAR_MESAS";
            List <string> inParam       = new List <string>();
            List <string> outParam      = new List <string>();
            List <string> result        = new List <string>();

            inParam.Add(estadoMesaId.ToString());
            outParam.Add("o_cursor");
            outParam.Add("o_error");

            var oReader = _IResultlSetHelper.executePackage(packageName, procedureName, inParam, outParam, "o_cursor");

            if (oReader.Rows.Count > 0)
            {
                foreach (DataRow row in oReader.Rows)
                {
                    mesa.mesaId           = int.Parse(row[0].ToString());
                    mesa.nombre           = row[1].ToString();
                    mesa.cantidadPersonas = int.Parse(row[2].ToString());
                    mesa.estadoMesa       = row[3].ToString();
                    mesa.ubicacionMesa    = row[4].ToString();
                    response.listaMesas.Add(mesa);
                }
                response.code    = 0;
                response.message = "OK";
            }
            else
            {
                response.code    = 999;
                response.message = String.Concat("NoOk - ", result[2].ToString());
            }

            return(response);
        }