示例#1
0
    // 繫結資料 Detail
    private void databind_Detail()
    {
        #region
        try
        {
            ErrorMsgLabel.Text = "";
            MaintainPurchaseOrder bco = new MaintainPurchaseOrder(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(this.hiddenPurchaseNo.Value);
            DataTable Dt = bco.GetItemsByPurchase_No(ParameterList);//取正常品Detail資料
            DataTable DtAll = bco.GetAllItemsByPurchase_No(ParameterList);//取正常品與贈品資料

            //將明細資料放至DetailDt中
            Session["PUR02_DTL_" + PageTimeStamp.Value] = Dt;

            ViewState["DetailOLDData"] = ChangeNullValues(Dt);
            ViewState["AllDetailOLDData"] = ChangeNullValues(DtAll);

            this.setGV_Detail(-1, Dt, false);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }