Ejemplo n.º 1
0
        //分页
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            string po_no      = id_po_NO.Value.Trim();
            string item_name  = id_item_Name.Value.Trim();
            string receipt_no = id_receipt_NO.Value.Trim();

            GridView1.PageIndex = e.NewPageIndex;

            Receive_mtlDC receive_mtlDC = new Receive_mtlDC();//po退回的DataCenter对象
            DataSet       ds            = receive_mtlDC.getSomeFieldsByReceipt_noAndPO_noAndItem_name(receipt_no, po_no, item_name);

            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Ejemplo n.º 2
0
        //查询
        protected void select_click(object sender, EventArgs e)
        {
            string po_no      = id_po_NO.Value.Trim();
            string item_name  = id_item_Name.Value.Trim();
            string receipt_no = id_receipt_NO.Value.Trim();

            Receive_mtlDC receive_mtlDC = new Receive_mtlDC();//po退回的DataCenter对象
            DataSet       ds            = receive_mtlDC.getSomeFieldsByReceipt_noAndPO_noAndItem_name(receipt_no, po_no, item_name);

            if (ds == null)
            {
                PageUtil.showToast(this, "未查询到数据!");
                id_receipt_NO.Value = "";
                id_item_Name.Value  = "";
                id_po_NO.Value      = "";
                return;
            }
            else
            {
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    try
                    {
                        dt.Rows[i]["rcv_qty"] = int.Parse(dt.Rows[i]["rcv_qty"].ToString()) - int.Parse(dt.Rows[i]["return_qty"].ToString()) - int.Parse(dt.Rows[i]["deliver_qty"].ToString());
                    }
                    catch (Exception ex)
                    {
                        //PageUtil.showToast(this, "数据异常");
                        Console.Write(ex.Source);
                    }
                }
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
        }