コード例 #1
0
        public string Get(bool externalUrlFlag, string customerNumber)
        {
            string rv = @"<table class='flextable'><tr><th>SELECT</th><th width='7%'><span>REORDER REFILL QTY</span></th></tr><tr><td><input type='radio' /></td><td>row1</td></tr><tr><td><input type='radio'/></td><td>row 2</td></tr><tr><td><input type='radio' ></td><td>row 3</td></tr></table>";


            List <Models.Data> orderProfileResponse = new List <Models.Data>();

            orderProfileResponse = GetOrderProfileMock();

            List <OrderProfileView> orderProfileViewList = new List <OrderProfileView>();

            if (orderProfileResponse.Count > 0)
            {
                foreach (Data item in orderProfileResponse)
                {
                    OrderProfileView row = ConvertToView(item);
                    orderProfileViewList.Add(row);
                }
            }

            //var table = orderProfileResponse.ToHtmlTable();

            var table = orderProfileViewList.ToHtmlTable();

            rv = table.ToString().Trim();

            return(rv);
        }
コード例 #2
0
        private OrderProfileView ConvertToView(Data singleOrder)
        {
            OrderProfileView singleView = new OrderProfileView();

            singleView.SELECT          = "<input type='radio' />";
            singleView.REORDER         = "";
            singleView.STATUS          = singleOrder.order_stat;
            singleView.DESCRIPTION     = singleOrder.description;
            singleView.QTY             = singleOrder.quantity;
            singleView.DATE_OF_SERVICE = singleOrder.dos;
            singleView.HCPC            = singleOrder.hcpcs;
            singleView.TRACKING        = singleOrder.tracking35;

            return(singleView);
        }
コード例 #3
0
        public List <OrderProfileView> GetAllOrders()
        {
            List <OrderProfileView> orders = new List <OrderProfileView>();

            using (DemoEntities1 db = new DemoEntities1())
            {
                OrderProfileView OV;

                //var orderData = db.laporans.ToList(); ???

                foreach (laporan l in db.laporans)
                {
                    OV            = new OrderProfileView();
                    OV.id_laporan = l.id_laporan;

                    pelanggan pelanggan = db.pelanggans.Where(o => o.id_pelanggan.Equals(l.id_pelanggan)).FirstOrDefault();

                    OV.namapelanggan = pelanggan.nama;

                    outbond outbond = db.outbonds.Where(o => o.id_outbond.Equals(l.id_outbond)).FirstOrDefault();
                    OV.namaoutbond = outbond.keterangan;

                    OV.keterangan = l.keterangan;
                    OV.tgl_akhir  = (DateTime)l.tgl_akhir;
                    OV.tgl_mulai  = (DateTime)l.tgl_mulai;
                    OV.tgl_pesan  = (DateTime)l.tgl_pesan;
                    OV.harga      = l.harga;
                    OV.quantity   = l.quantity;
                    OV.jumlah     = l.jumlah;

                    orders.Add(OV);
                }
            }

            orders.Reverse();
            return(orders);
        }