コード例 #1
0
ファイル: ProductStock.aspx.cs プロジェクト: 892182825/SP
    /// <summary>
    /// 绑定库位产品明细
    /// </summary>
    private void BindDepotSeatProductDetails()
    {
        dt = WareHouseProductDetailsBLL.GetMoreProductInfoByWareHouseIDDepotSeatID(Convert.ToInt32(Session["WareHouseID"]), Convert.ToInt32(Session["DepotSeatID"]));
        this.lbl_storename.Visible = false;
        if (dt.Rows.Count < 1)
        {
            this.lbl_flag.Text = GetTran("001946", "没有相关数据");
        }
        else
        {
            this.lbl_flag.Text = GetTran("000357", "库位名称") + ":" + dt.Rows[0][1].ToString();
        }
        this.lbl_title.Text = GetTran("000390", "库位");

        string table   = " ProductQuantity a,Product b,WareHouse c ,DepotSeat j";
        string columus = " C.WareHouseName,j.SeatName,a.ProductID,b.ProductCode,b.ProductName," +
                         " (select d.ProductUnitName from ProductUnit as d where ProductUnitID=b.BigProductUnitID) as ProductBigUnitName," +
                         " (select d.ProductUnitName from ProductUnit as d where ProductUnitID=b.SmallProductUnitID) as ProductSmallUnitName ," +
                         " b.Weight," +
                         " convert(nvarchar(20),b.Length)+'*'+Convert(nvarchar(20),b.Width)+'*'+Convert(nvarchar(20),b.High) as Cubage," +
                         " sum(a.TotalIn) as TotalIn," +
                         " sum(a.TotalOut) as TotalOut ," +
                         " sum(a.TotalIn-a.TotalOut) as TotalEnd," +
                         " sum(b.AlertnessCount)as AlertnessCount ";

        string where = " a.ProductID=b.ProductID and a.WareHouseID=c.WareHouseID and c.WareHouseID=j.WareHouseID and a.DepotSeatID=j.DepotSeatID and a.DepotSeatID=" + Session["DepotSeatID"] + "  and a.wareHouseID=" + Session["WareHouseID"];

        string group = " C.WareHouseName,j.SeatName,a.ProductID,b.ProductCode,b.ProductName, b.BigProductUnitID,b.SmallProductUnitID, b.Weight,b.Length,b.Width,b.High";

        Pager1.PageBindGroup(0, 10, table, columus, where, " a.ProductID ", group, "gvProduct");
        //this.gvProduct.DataSource = dt;
        //this.gvProduct.DataBind();
    }