//protected void CountTotal()
    //{
    //    decimal qty = 0.00M;
    //    decimal amount = 0.00M;
    //    foreach (DataRow row in dsDetail.Tables[0].Rows)
    //    {
    //        qty += Convert.ToDecimal(row["QUANTITY"]);
    //        amount += Convert.ToDecimal(row["QUANTITY"]) * Convert.ToDecimal(row["PRICE"]);
    //    }
    //}
    #endregion

    #region  载选中的单据

    protected void btnDown_Click(object sender, EventArgs e)
    {
        CheckBox chk         = new CheckBox();
        string   billnolist  = "";
        bool     hasSelected = false;

        if (gvMaster.Rows.Count >= 1)
        {
            for (int i = 0; i < gvMaster.Rows.Count; i++)
            {
                chk = (CheckBox)gvMaster.Rows[i].Cells[1].Controls[0];
                if (chk.Checked)
                {
                    billnolist += gvMaster.Rows[i].Cells[2].Text.ToString() + ",";
                    hasSelected = true;
                }
            }
            if (hasSelected)
            {
                bll.DownProductInfo();//下载产品
                billnolist = billnolist.Substring(0, billnolist.Length - 1);
                string inbillno = UtinString.StringMake(billnolist);
                inbill.GetInBillManual(inbillno, Session["EmployeeCode"].ToString());
                JScript.Instance.ShowMessage(this.UpdatePanel1, "已选择的单据下载完成!");
            }
            else
            {
                JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择要下载的单据!");
            }
        }
        else
        {
            JScript.Instance.ShowMessage(this.UpdatePanel1, "没有数据可以下载!");
        }
    }