Пример #1
0
    private DataTable MakeDetailTable(string strOutLS, string strInLS)
    {
        PIC.VDS2G.GFM.ITM.MaintainSKUPeriod bco = new PIC.VDS2G.GFM.ITM.MaintainSKUPeriod(ConntionDB);

        DataTable Dt_Detail = new DataTable();

        Dt_Detail.Columns.Add("OUT_LS");
        Dt_Detail.Columns.Add("IN_LS");
        Dt_Detail.Columns.Add("ITEM");
        Dt_Detail.Columns.Add("PERIOD");
        Dt_Detail.Columns.Add("REMOVE_QTY");
        Dt_Detail.Columns.Add("COST");

        string strITEM = string.Empty;//品號
        string strPERIOD = string.Empty;//期別
        string strONHDX_QTY = string.Empty;//出庫儲位庫存量
        string strST_ACCEPT_QTY = string.Empty;//進貨數量
        int intONHDX_QTY = 0;
        int intST_ACCEPT_QTY = 0;
        int x = 0;
        int y = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            strITEM = GridView1.Rows[i].Cells[0].Text;
            strPERIOD = GridView1.Rows[i].Cells[1].Text;
            strONHDX_QTY = GridView1.Rows[i].Cells[6].Text;
            strST_ACCEPT_QTY = GridView1.Rows[i].Cells[9].Text;

            if (int.TryParse(strONHDX_QTY, out x))
            {
                intONHDX_QTY = x;
            }
            else
            {
                intONHDX_QTY = 0;
            }

            if (int.TryParse(strST_ACCEPT_QTY, out y))
            {
                intST_ACCEPT_QTY = y;
            }
            else
            {
                intST_ACCEPT_QTY = 0;
            }

            //如果[出庫儲位庫存量] < [進貨數量],要建移轉單
            if (intONHDX_QTY < intST_ACCEPT_QTY)
            {
                ParameterList.Clear();

                ParameterList.Add(strPERIOD);
                ParameterList.Add(strITEM);

                DataTable Dt_Cost = bco.QueryForSLP(ParameterList);

                DataRow Dr_Detail = Dt_Detail.NewRow();

                Dr_Detail["OUT_LS"] = strOutLS;
                Dr_Detail["IN_LS"] = strInLS;
                Dr_Detail["ITEM"] = strITEM;
                Dr_Detail["PERIOD"] = strPERIOD;
                Dr_Detail["REMOVE_QTY"] = intST_ACCEPT_QTY;
                Dr_Detail["COST"] = Dt_Cost.Rows[0]["COST"];

                Dt_Detail.Rows.Add(Dr_Detail);
            }
        }

        return Dt_Detail;



    }
Пример #2
0
    public string ItemPeriodName(string Code,
                                 string Item
                                 )
    {
        string Name = "";
        string ConnectionDBStr = ((DatabaseSettings)ConfigurationManager.GetSection("dataConfiguration")).DefaultDatabase;
        MaintainSKUPeriod bco = new MaintainSKUPeriod(ConnectionDBStr);

        if (Code != "")
        {
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(Code);
            ParameterList.Add(Item);                

            DataTable dt = bco.QueryForSLP(ParameterList);

            Name = ((dt.Rows.Count > 0) ? "" : "查無資料");            
        }

        return Name;
    }