コード例 #1
0
ファイル: Affiliate.cs プロジェクト: xRegner/uxi_liberaciones
        private OrdenDeCompraDetalle ProcessDataJsonDetail(string strDataJson)
        {
            OrdenDeCompraDetalle obj = new OrdenDeCompraDetalle();

            obj = JsonConvert.DeserializeObject <OrdenDeCompraDetalle>(strDataJson);
            return(obj);
        }
コード例 #2
0
        public ActionResult _detalleOrden(int idoc, int ide)
        {
            int                  sessionUsr = 0;
            Affiliate            aff        = new Affiliate();
            OrdenDeCompraDetalle detail     = new OrdenDeCompraDetalle();

            try
            {
                sessionUsr = Session["UserID"].ToString() != "" ? Convert.ToInt16(Session["UserID"].ToString()) : 0;
                if (sessionUsr != 0)
                {
                    detail = aff.getOrdenDetail(idoc);

                    ViewData["listEstatus"] = (from e in aff._listaEstatus() where e.IdEstatusOC != 5 select e).ToList();
                }
                else
                {
                    return(RedirectToAction("Index", "Index"));
                }
            }
            catch
            {
                return(RedirectToAction("Index", "Index"));
            }

            return(PartialView(detail));
        }
コード例 #3
0
ファイル: Affiliate.cs プロジェクト: xRegner/uxi_liberaciones
        public OrdenDeCompraDetalle getOrdenDetail(int idoc)
        {
            OrdenDeCompraDetalle Detail = new OrdenDeCompraDetalle();
            var baseAddres = api + "api/OrdenService/GetDetail";

            using (var wc = new WebClient())
            {
                wc.QueryString.Add("IdOrdenCompra", idoc.ToString());
                string _result = wc.DownloadString(baseAddres);
                Detail = ProcessDataJsonDetail(_result);
            }

            return(Detail);
        }
コード例 #4
0
        public ActionResult _detalleOrden(OrdenDeCompraDetalle Detail)
        {
            Affiliate aff = new Affiliate();

            if (aff.updOrdenStatus(idoc: Detail.IdOrdenCompra, ide: Detail.IdEstatus))
            {
                var redirectUrl = new UrlHelper(Request.RequestContext).Action("Index", "Home");
                return(Json(new { Url = redirectUrl }));
            }

            ViewData["listEstatus"] = (from e in aff._listaEstatus() where e.IdEstatusOC != 5 select e).ToList();

            return(PartialView(Detail));
        }
コード例 #5
0
        public OrdenDeCompraDetalle GetDetail(int IdOrdenCompra)
        {
            OrdenDeCompraDetalle         listDetail = new OrdenDeCompraDetalle();
            List <ProductosDetalleOrden> Productos  = new List <ProductosDetalleOrden>();

            using (uxisolutionbdEntities context = new uxisolutionbdEntities())
            {
                var query = (from det in context.sp_getOrderDetail(IdOrdenCompra)
                             select det);

                listDetail.IdOrdenCompra = IdOrdenCompra;
                listDetail.IdEstatus     = (from odc in context.TblOrdenDeCompra where odc.IdOrdenCompra == IdOrdenCompra select odc.IdEstatusOC).FirstOrDefault();

                foreach (sp_getOrderDetail_Result item in query)
                {
                    ProductosDetalleOrden prod = new ProductosDetalleOrden
                    {
                        IdDetail    = item.IdODC,
                        PrecioNeto  = item.PrecioNeto,
                        PrecioVenta = item.PrecioVenta,
                        Total       = item.Total,
                        IdDescuento = item.IdDescuento,
                        Producto    = new Servicios()
                        {
                            IdProducto        = item.IdProducto,
                            Descripcion_Corta = item.Descripcion_Corta,
                            Descripcion_Larga = item.Descripcion_Larga,
                            SKU  = item.SKU,
                            IMEI = item.IMEI
                        }
                    };
                    Productos.Add(prod);
                }
                listDetail.Productos = Productos;
            }
            return(listDetail);
        }