Example #1
0
    private int CheckItemOverDate(string strItem)
    {
        int iResult = 1;//0:無資料 -1:過期 1:正常 -2:品號不屬於此供應商

        MaintainPurchaseOrder BCO = new MaintainPurchaseOrder(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(strItem);
        DataTable dt = BCO.QueryItem(ParameterList);

        if (dt.Rows.Count > 0)
        {
            if (PUR_VendorCode.Text.Trim() != dt.Rows[0]["MANUFACTURE"].ToString().Trim())
            {
                iResult = -2;
            }
            else
            {
                string strNowDate = DateTime.Now.ToString("yyyy/MM/dd");
                if (string.Compare(dt.Rows[0]["mdc_end_date"].ToString(), strNowDate) < 0)
                {
                    iResult = -1;
                }
            }

        }
        else
        {
            iResult = 0;
        }

        return iResult;
    }
Example #2
0
    private static int CheckItemDate(string sItem)
    {
        int iResult = -2; //-2:無資料 -1:過期 0:正常
        MaintainPurchaseOrder BCO = new MaintainPurchaseOrder(ConntionDB);
        ParameterList.Clear();
        ParameterList.Add(sItem);
        DataTable dt = BCO.QueryItem(ParameterList);

        if (dt.Rows.Count > 0)
        {
            string strNowDate = DateTime.Now.ToString("yyyy/MM/dd");
            if (string.Compare(dt.Rows[0]["mdc_end_date"].ToString(), strNowDate) < 0)
            {
                iResult = -1;
            }
            else
            {
                iResult = 0;
            }
        }
        return iResult;
    }