protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");

                Sell_OrderOutHouseBacks model = e.Row.DataItem as Sell_OrderOutHouseBacks;
                SumOrders.GoodNum            += model.GoodNum;
                SumOrders.Total              += model.Total;
                SumOrders.GoodSellPriceTotal += model.GoodSellPriceTotal;
            }
            //ImageButton btnEdit = e.Row.FindControl("btnEdit") as ImageButton;
            //if (btnEdit != null)
            //{
            //    string val = string.Format("javascript:window.showModalDialog('CG_Orders.aspx?index={0}',null,'dialogWidth:500px;dialogHeight:450px;help:no;status:no')", e.Row.DataItemIndex);
            //    btnEdit.Attributes.Add("onclick", val);
            //}


            // 合计
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                setValue(e.Row.FindControl("lblGoodName") as Label, "合计");                                  //合计
                setValue(e.Row.FindControl("lblNum") as Label, SumOrders.GoodNum.ToString());               //数量

                setValue(e.Row.FindControl("lblTotal1") as Label, SumOrders.GoodSellPriceTotal.ToString()); //成本总额
            }
        }
        protected void LinkButton1_Click1(object sender, EventArgs e)
        {
            if (Session["Orders"] != null)
            {
                if (Session["OrderInHouseSession"] != null)
                {
                    object selectedId = Session["OrderInHouseSession"];
                    if (selectedId != null)
                    {
                        Sell_OrderOutHousesService sellOrderServer         = new Sell_OrderOutHousesService();
                        Sell_OrderOutHouseService  sellOrderMainServer     = new Sell_OrderOutHouseService();
                        Sell_OrderOutHouse         sell_OrderOutHouseModel = sellOrderMainServer.GetModel(Convert.ToInt32(selectedId));
                        txtSupplier.Text  = sell_OrderOutHouseModel.Supplier;
                        txtSellProNo.Text = sell_OrderOutHouseModel.ProNo;
                        txtPOName.Text    = sell_OrderOutHouseModel.POName;
                        txtPONo.Text      = sell_OrderOutHouseModel.PONo;
                        lblTotal.Text     = sell_OrderOutHouseModel.SellTotal.ToString();

                        List <Sell_OrderOutHouses> POOrders = sellOrderServer.Sell_OrderOutHouse_Sell_OrderInHouse_ListView(" id=" + selectedId);;

                        List <Sell_OrderOutHouseBacks> sellOrderOutList = new List <Sell_OrderOutHouseBacks>();
                        foreach (var model in POOrders)
                        {
                            Sell_OrderOutHouseBacks sellOrderOutModel = new Sell_OrderOutHouseBacks()
                            {
                                Good_Model = model.Good_Model,
                                GoodName   = model.GoodName,
                                GoodNo     = model.GoodNo,
                                GoodNum    = model.GoodNum,
                                GoodPrice  = model.GoodPrice,
                                //GoodRemark = model.GoodRemark,
                                GoodSellPrice      = model.GoodSellPrice,
                                GoodSellPriceTotal = model.GoodSellPriceTotal,
                                GoodSpec           = model.GoodSpec,
                                GoodTypeSmName     = model.GoodTypeSmName,
                                GoodUnit           = model.GoodUnit,
                                GooId     = model.GooId,
                                HouseID   = model.HouseID,
                                HouseName = model.HouseName,
                                SellId    = model.Ids,
                                Total     = model.Total,
                            };
                            sellOrderOutList.Add(sellOrderOutModel);
                        }
                        Session["Orders"] = sellOrderOutList;

                        Session["OrderInHouseSession"] = null;
                        gvList.DataSource = sellOrderOutList;
                        gvList.DataBind();
                    }
                    //}

                    //List<Sell_OrderOutHouseBacks> selectedList = Session["DioSellWFHouseGoods"] as List<Sell_OrderOutHouseBacks>;
                    //if (selectedList.Count > 0)
                    //{
                    //    List<Sell_OrderOutHouseBacks> POOrders = Session["Orders"] as List<Sell_OrderOutHouseBacks>;
                    //    if (POOrders == null) POOrders = new List<Sell_OrderOutHouseBacks>();
                    //    POOrders.AddRange(selectedList);
                    //    Session["DioSellWFHouseGoods"] = null;
                    //    gvList.DataSource = POOrders;
                    //    gvList.DataBind();
                    //    Session["Orders"] = POOrders;
                    //}
                }
            }
        }