protected void bt_Out_Click(object sender, EventArgs e)
    {
        Save();
        if ((int)ViewState["PriceID"] == 0)
        {
            return;
        }

        PDT_StandardPriceBLL _bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]);

        foreach (GridViewRow row in gv_List.Rows)
        {
            CheckBox cb_check = (CheckBox)row.FindControl("cb_Check");
            if (cb_check.Checked)
            {
                PDT_StandardPrice_Detail       item2   = _bll.GetDetailModel(int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString()));
                PDT_StandPriceChangeHistoryBLL history = new PDT_StandPriceChangeHistoryBLL();
                history.Model.StandardPrice    = _bll.Model.ID;
                history.Model.ChangeType       = 3;
                history.Model.ChageTime        = DateTime.Now;
                history.Model.ChangeStaff      = (int)Session["UserID"];
                history.Model.Product          = item2.Product;
                history.Model.PreFactoryPrice  = item2.FactoryPrice;
                history.Model.PreTradeOutPrice = item2.TradeOutPrice;
                history.Model.PreTradeInPrice  = item2.TradeInPrice;
                history.Model.PreStdPrice      = item2.StdPrice;
                history.Add();
                _bll.DeleteDetail(int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString()));
            }
        }
        Response.Redirect("PDT_StandardPriceDetail.aspx?PriceID=" + ViewState["PriceID"].ToString());
    }
    protected void bt_Out_Click(object sender, EventArgs e)
    {
        Save();
        if ((int)ViewState["PriceID"] == 0) return;

        PDT_StandardPriceBLL _bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]);

        foreach (GridViewRow row in gv_List.Rows)
        {
            CheckBox cb_check = (CheckBox)row.FindControl("cb_Check");
            if (cb_check.Checked)
            {
                PDT_StandardPrice_Detail item2 = _bll.GetDetailModel(int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString()));
                PDT_StandPriceChangeHistoryBLL history = new PDT_StandPriceChangeHistoryBLL();
                history.Model.StandardPrice = _bll.Model.ID;
                history.Model.ChangeType = 3;
                history.Model.ChageTime = DateTime.Now;
                history.Model.ChangeStaff = (int)Session["UserID"];
                history.Model.Product = item2.Product;
                history.Model.PreFactoryPrice = item2.FactoryPrice;
                history.Model.PreTradeOutPrice = item2.TradeOutPrice;
                history.Model.PreTradeInPrice = item2.TradeInPrice;
                history.Model.PreStdPrice = item2.StdPrice;
                history.Add();
                _bll.DeleteDetail(int.Parse(gv_List.DataKeys[row.RowIndex]["ID"].ToString()));
            }
        }
        Response.Redirect("PDT_StandardPriceDetail.aspx?PriceID=" + ViewState["PriceID"].ToString());
    }