Beispiel #1
0
        public JsonResult Obtener_Periodo2(string v_codequipo, string v_codreporte)
        {
            M_LlenarCombo_Service service = new M_LlenarCombo_Service();
            llenarCombos_Request  ollenarCombos_Request = new llenarCombos_Request();
            E_DinamicArray        oE_DinamicArray       = new E_DinamicArray();

            ollenarCombos_Request.opcion  = "27";
            ollenarCombos_Request.filtros = v_codequipo.ToString() + "," + v_codreporte.ToString();


            oE_DinamicArray = service.Llenar_Combo(ollenarCombos_Request);
            int            v_cant       = oE_DinamicArray.Contents.Length;
            List <M_combo> oListM_combo = new List <M_combo>();

            for (int x = 0; x < v_cant; x++)
            {
                int     v_cant2  = oE_DinamicArray.Contents[x].Length;
                M_combo oM_combo = new M_combo();
                oM_combo.codigo      = oE_DinamicArray.Contents[x][0];
                oM_combo.descripcion = oE_DinamicArray.Contents[x][1];

                oListM_combo.Add(oM_combo);
            }

            var modelData = oListM_combo.Select(u => new SelectListItem()
            {
                Value = u.codigo.ToString(),
                Text  = u.descripcion.ToString(),
            });

            return(Json(modelData, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public JsonResult Obtener_Provin(int v_codcliente, string v_codequipo, string v_codtipcadena, string v_codcadena, string v_coddepart)
        {
            M_LlenarCombo_Service service = new M_LlenarCombo_Service();
            llenarCombos_Request  ollenarCombos_Request = new llenarCombos_Request();
            E_DinamicArray        oE_DinamicArray       = new E_DinamicArray();

            ollenarCombos_Request.opcion  = "7";
            ollenarCombos_Request.filtros = "774," + v_codcliente.ToString() + "," + v_codequipo.ToString() + "," + v_codtipcadena.ToString() + "," + v_codcadena.ToString() + "," + v_coddepart.ToString();


            oE_DinamicArray = service.Llenar_Combo(ollenarCombos_Request);
            int            v_cant       = oE_DinamicArray.Contents.Length;
            List <M_combo> oListM_combo = new List <M_combo>();

            for (int x = 0; x < v_cant; x++)
            {
                int     v_cant2  = oE_DinamicArray.Contents[x].Length;
                M_combo oM_combo = new M_combo();
                oM_combo.codigo      = oE_DinamicArray.Contents[x][0];
                oM_combo.descripcion = oE_DinamicArray.Contents[x][1];

                oListM_combo.Add(oM_combo);
            }

            if (oListM_combo.Count > 0)
            {
                var modelData = oListM_combo.Select(u => new SelectListItem()
                {
                    Value = u.codigo.ToString(),
                    Text  = u.descripcion.ToString(),
                });
                return(Json(modelData, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var modelData = new List <SelectListItem>
                {
                    new SelectListItem {
                        Value = "0", Text = "Sin resultado"
                    }
                };
                return(Json(modelData, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #3
0
        //Creado Por :Ditmar Estrada
        //18/09/2013
        public JsonResult Obtener_GiesPorCampaniaUbigeo
            (string v_codequipo, string v_codpais, string v_codDept, string v_codCity)
        {
            M_LlenarCombo_Service service = new M_LlenarCombo_Service();
            llenarCombos_Request  ollenarCombos_Request = new llenarCombos_Request();
            E_DinamicArray        oE_DinamicArray       = new E_DinamicArray();

            ollenarCombos_Request.opcion  = "12";
            ollenarCombos_Request.filtros = v_codequipo + "," + v_codpais + "," + v_codDept + "," + v_codCity;

            oE_DinamicArray = service.Llenar_Combo(ollenarCombos_Request);
            int            v_cant       = oE_DinamicArray.Contents.Length;
            List <M_combo> oListM_combo = new List <M_combo>();

            for (int x = 0; x < v_cant; x++)
            {
                M_combo oM_combo = new M_combo();
                oM_combo.codigo      = oE_DinamicArray.Contents[x][0];
                oM_combo.descripcion = oE_DinamicArray.Contents[x][1];

                oListM_combo.Add(oM_combo);
            }

            if (oListM_combo.Count > 0)
            {
                var modelData = oListM_combo.Select(u => new SelectListItem()
                {
                    Value = u.codigo.ToString(),
                    Text  = u.descripcion.ToString(),
                });
                return(Json(modelData, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var modelData = new List <SelectListItem>
                {
                    new SelectListItem {
                        Value = "0", Text = "Sin resultado"
                    }
                };
                return(Json(modelData, JsonRequestBehavior.AllowGet));
            }
        }