Esempio n. 1
0
    /// <summary>
    /// 갮ھڰt���Ǹ��ot��ӫ~
    /// </summary>
    /// <param name="strDisNo"></param>
    private void GetDisItemByDisNo(string strDisNo)
    {
        #region
        DataTable dt = new DataTable();
        try
        {

            if (strDisNo != "")
            {
                ArrayList ParameterList = new ArrayList();//20091113

                ParameterList.Clear();
                ParameterList.Add(strDisNo);
                ALOModel.MaintainDisItem BCO = new ALOModel.MaintainDisItem(ConnectionDB);
                dt = BCO.QueryDisItemFor111(ParameterList);
            }

            if (dt != null && dt.Rows.Count > 0)
            {
                //���������n����
                for (int x = dt.Columns.Count - 1; x >= 0; x--)
                {
                    if (dt.Columns[x].ColumnName != "DIS_NO" &&
                        dt.Columns[x].ColumnName != "ITEM" &&
                        dt.Columns[x].ColumnName != "PERIOD")
                    {
                        dt.Columns.RemoveAt(x);
                    }
                }
                dt.AcceptChanges();
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }

        dtDisItem = dt;
        dt.Dispose();

        #endregion
    }
Esempio n. 2
0
    /// <summary>
    /// 查詢配本商品
    /// </summary>
    /// <param name="dis_no">配本序號</param>
    /// <param name="approve_date">確認日期</param>
    /// <param name="item">回傳->配本商品品號</param>
    /// <param name="period">回傳->配本商品期別</param>
    private void getDis_Item(string dis_no, string approve_date, out string item, out string period)
    {
        item = "";
        period = "";
        try
        {
            ArrayList ParameterList = new ArrayList();//20091113

            ParameterList.Clear();
            ParameterList.Add(dis_no); //配本序號
            BCO.MaintainDisItem bco = new BCO.MaintainDisItem(ConnectionDB);
            DataTable dt;
            dt = bco.QueryDisItemFor111(ParameterList);
            if (dt.Rows.Count > 0)
            {
                if (approve_date == "")
                {
                    btnPrev2.Enabled = true;
                    btnNext2.Enabled = true;
                    btnQuery2.Enabled = true;
                }
                GridView1.DataSource = dt;
                GridView1.DataBind();
                SLP_ITEM.Text = dt.Rows[0]["ITEM"].ToString();
                SLP_PERIOD.Text = dt.Rows[0]["PERIOD"].ToString();
                txtN_ONHD_QTY.Text = dt.Rows[0]["N_ONHD_QTY"].ToString().Length == 0 ? "0" : dt.Rows[0]["N_ONHD_QTY"].ToString(); //採購量
                txtN_PER_QTY.Text = dt.Rows[0]["N_PER_QTY"].ToString().Length == 0 ? "0" : dt.Rows[0]["N_PER_QTY"].ToString(); //可配量
                SLP_DIS_TYPE.Text = dt.Rows[0]["DIS_TYPE"].ToString();

                hidITEM.Value = dt.Rows[0]["ITEM"].ToString();
                hidPERIOD.Value = dt.Rows[0]["PERIOD"].ToString();
                hidN_ONHD_QTY.Value = dt.Rows[0]["N_ONHD_QTY"].ToString().Length == 0 ? "0" : dt.Rows[0]["N_ONHD_QTY"].ToString();
                hidN_PER_QTY.Value = dt.Rows[0]["N_PER_QTY"].ToString().Length == 0 ? "0" : dt.Rows[0]["N_PER_QTY"].ToString();
                hidRoot_No.Value = dt.Rows[0]["Root_No"].ToString();

                item = dt.Rows[0]["ITEM"].ToString();
                period = dt.Rows[0]["PERIOD"].ToString();
                hidID.Value = dt.Rows[0]["ID"].ToString(); //ID值,供上、下筆查詢時使用
                hidNum.Value = "1";

                string SessionIDName = "ALO121_dt1" + PageTimeStamp.Value;
                Session[SessionIDName] = dt;
            }
        }
        catch (Exception ex)
        {
            lblErrorQ1.Text = ex.Message;
            lblErrorQ1.Visible = true;
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 配本商品列表GridView
    /// </summary>
    private void ItemGridViewBind()
    {
        ALOModel.MaintainDisItem bco = new ALOModel.MaintainDisItem(ConnectionDB);

        #region 輸入變數

        ArrayList ParameterList = new ArrayList();
        ParameterList.Clear();
        ParameterList.Add(DISNOTxt.Text);

        #endregion

        DataTable Dt = bco.QueryDisItemFor111(ParameterList);

        #region 使用XML放置到前端資料

        XML_GridViewItemList.InnerHtml = (Dt.Rows.Count > 0) ? Dt.DataSet.GetXml() : "";

        #endregion

        SessionIDName = "ALO111ItemGridViewDv_" + PageTimeStamp.Value;

        DataView dv = Dt.DefaultView;

        if (SLP_SKU0.Text != "") //有輸入過濾商品品號
        {
            dv.RowFilter = "ITEM='" + SLP_SKU0.Text + "'";
        }

        Session[SessionIDName] = dv;
        GridView_ItemList.DataSource = dv;
        GridView_ItemList.DataBind();

    }