Exemplo n.º 1
0
    private bool GetTaxType(string strItem, string strPeriod)
    {
        #region
        bool bResult = false;
        try
        {

            //ITMModel.MaintainSKUPeriod BCO = new ITMModel.MaintainSKUPeriod(ConnectionDB);
            //ParameterList.Clear();
            //ITMModel.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "ITEM", strItem, "=", "and");
            //ITMModel.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.PERIOD", strPeriod, "=", "and");
            // DataTable dt = BCO.QuerySKUPeriodByFind_1(ParameterList);

            DataTable dt = null;

            if (strItem != "" && strPeriod != "")
            {
                ArrayList ParameterList = new ArrayList();

                ParameterList.Clear();
                ParameterList.Add(strItem);
                ParameterList.Add(strPeriod);
                ALOModel.QueryALOCommon BCO = new ALOModel.QueryALOCommon(ConnectionDB);
                dt = BCO.QueryItemPeriodInfo(ParameterList);
            }

            if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["TAX_TYPE"] != null && dt.Rows[0]["TAX_TYPE"].ToString().Trim() != "")
            {
                i_TaxType = Int32.Parse(dt.Rows[0]["TAX_TYPE"].ToString().Trim());
                bResult = true;
            }
            else
            {
                i_TaxType = 0;
                bResult = false;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return bResult;

        #endregion
    }
Exemplo n.º 2
0
    /// <summary>
    /// 取得商品期別資訊
    /// </summary>
    /// <param name="strItem"></param>
    /// <param name="strPeriod"></param>
    /// <returns></returns>
    private bool GetTaxType(string strItem, string strPeriod)
    {
        #region
        bool bResult = false;
        try
        {

            DataTable dt = null;

            if (strItem != "" && strPeriod != "")
            {
                ArrayList ParameterList = new ArrayList();//20091113

                ParameterList.Clear();
                ParameterList.Add(strItem);
                ParameterList.Add(strPeriod);
                ALOModel.QueryALOCommon BCO = new ALOModel.QueryALOCommon(ConnectionDB);
                dt = BCO.QueryItemPeriodInfo(ParameterList);
            }

            if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["TAX_TYPE"] != null && dt.Rows[0]["TAX_TYPE"].ToString().Trim() != "")
            {
                bResult = true;
            }
            else
            {
                bResult = false;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return bResult;

        #endregion
    }
Exemplo n.º 3
0
    private string CheckByItemAndPeriod(string strItem, string strPeriod)
    {
        #region

        string strReuslt = "";
        try
        {
            ALOModel.QueryALOCommon BCO_comm = new ALOModel.QueryALOCommon(ConnectionDB);
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(strItem);
            ParameterList.Add(strPeriod);

            DataTable dtTemp = BCO_comm.QueryItemPeriodInfo(ParameterList);

            if (dtTemp.Rows.Count > 0)
            {
                strReuslt = dtTemp.Rows[0]["PRICE"].ToString();
            }
            return strReuslt;

        }
        catch (Exception ex)
        {
            throw ex;
        }

        #endregion
    }
Exemplo n.º 4
0
    private bool GetPrice(string strItem, string strPeriod)
    {
        #region

        bool bResult = false;
        try
        {
            ALOModel.QueryALOCommon BCO_comm = new ALOModel.QueryALOCommon(ConnectionDB);
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(strItem);
            ParameterList.Add(strPeriod);

            DataTable dtTemp = BCO_comm.QueryItemPeriodInfo(ParameterList);

            if (dtTemp == null || dtTemp.Rows.Count <= 0)
            {
                bResult = false;
            }
            else
            {
                bResult = true;
            }

            return bResult;

        }
        catch (Exception ex)
        {
            throw ex;
        }

        #endregion
    }
Exemplo n.º 5
0
    private bool GetItemPeriodDisStateByItemPeriod(string strItem, string strPeriod, string strStAcceptDate, out string strErrMsg)
    {
        #region
        bool bResult = true;

        strErrMsg = "";
        try
        {

            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(strItem);
            ParameterList.Add(strPeriod);
            ParameterList.Add(strStAcceptDate);


            ALOModel.QueryALOCommon BCO_comm = new ALOModel.QueryALOCommon(ConnectionDB);
            DataTable dtTaxType = BCO_comm.QueryItemPeriodInfo(ParameterList);

            #region 取得稅別

            #endregion

            s_TAX_TYPE = "";

            if(dtTaxType!=null && dtTaxType.Rows.Count>0)
            {
                s_TAX_TYPE = dtTaxType.Rows[0]["TAX_TYPE"].ToString().Trim();
            }

            ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB);
            Hashtable htTemp = BCO.CheckItemPeriodDisState(ParameterList);

            #region 取得前六期期別

            s_B1_PERIOD = "";
            s_B2_PERIOD = "";
            s_B3_PERIOD = "";
            s_B4_PERIOD = "";
            s_B5_PERIOD = "";
            s_B6_PERIOD = "";

            if (htTemp != null && htTemp.Count != 0)
            {

                if (htTemp["PERIODEXIST"].ToString().Trim() == "0")
                {
                    strErrMsg = string.Format("期別{0},不存在於期別主檔", strPeriod);
                    bResult = false;
                }
                else if (htTemp["DIS_DATE"] == null || htTemp["DIS_DATE"].ToString().Trim() != "")
                {
                    strErrMsg = string.Format("該品號期別於該配本日期已配本");
                    bResult = true;
                }

                if (bResult)
                {
                    s_B1_PERIOD = htTemp["P_B1"].ToString();//前一期別
                    s_B2_PERIOD = htTemp["P_B2"].ToString();//前二期別
                    s_B3_PERIOD = htTemp["P_B3"].ToString();//前三期別
                    s_B4_PERIOD = htTemp["P_B4"].ToString();//前四期別
                    s_B5_PERIOD = htTemp["P_B5"].ToString();//前五期別
                    s_B6_PERIOD = htTemp["P_B6"].ToString();//前六期別

                    DateTime dtIssDate;
                    DateTime.TryParse(htTemp["ISS_DATE"].ToString(), out dtIssDate);
                    s_ISS_DATE = dtIssDate.ToString("yyyy/MM/dd");//發行日

                    GetItemPeriodStock(strItem, strPeriod);
                }
            }
            else 
            {
                strErrMsg = string.Format("期別{0},不存在於期別主檔", strPeriod);
                bResult = false;
            }
            #endregion
        }
        catch (Exception ex)
        {
            bResult = false;
            throw ex;
        }

        return bResult;
        #endregion
    }