コード例 #1
0
        // GET: Show
        public ActionResult Index()
        {
            List <T_PoJoinPR> listTic  = new List <T_PoJoinPR>();
            List <HoldingPO>  listTic2 = new List <HoldingPO>();
            List <HoldingPR>  listTic3 = new List <HoldingPR>();
            List <RejectPO>   listTic4 = new List <RejectPO>();
            List <RejectPR>   listTic5 = new List <RejectPR>();
            QueryCRUD         qr       = new QueryCRUD();

            listTic = qr.GetTPO();

            listTic2 = qr.GetTPOHolding();
            listTic3 = qr.GetT_PRHolding();
            listTic4 = qr.GetTPO_Reject();
            listTic5 = qr.GetTPR_Reject();

            if (listTic.Count == 0)
            {
                ViewBag.sumpo = "0";
                ViewBag.sumpr = "0";
            }
            listTic.ForEach((l) => {
                if (l.T_Po != null)
                {
                    ViewBag.sumpo = l.T_Po;
                    if (l.T_Po == "")
                    {
                        ViewBag.sumpo = "0";
                    }
                }
                if (l.T_PR != null)
                {
                    ViewBag.sumpr = l.T_PR;
                    if (l.T_PR == "")
                    {
                        ViewBag.sumpr = "0";
                    }
                }
            });
            try {
                if (listTic2.Count == 0)
                {
                    ViewBag.sumhopo = "0";
                }

                listTic2.ForEach((i) =>
                {
                    if (i.Area != null)
                    {
                        ViewBag.sumhopo = i.Area;
                    }
                });
                if (listTic3.Count == 0)
                {
                    ViewBag.sumhopr = "0";
                }
                listTic3.ForEach((li) => {
                    if (li.Area != null)
                    {
                        ViewBag.sumhopr = li.Area;
                    }
                });
            } catch {
                return(View());
            }
            try
            {
                if (listTic4.Count == 0)
                {
                    ViewBag.sumrepo = "0";
                }

                listTic4.ForEach((s) =>
                {
                    if (s.Area != null)
                    {
                        ViewBag.sumrepo = s.Area;
                    }
                });
                if (listTic5.Count == 0)
                {
                    ViewBag.sumrepr = "0";
                }
                listTic5.ForEach((si) => {
                    if (si.Area != null)
                    {
                        ViewBag.sumrepr = si.Area;
                    }
                });
            }
            catch
            {
                return(View());
            }



            return(View(listTic));
        }