示例#1
0
        public QEMFormula()
        {
            QFormulaCollection x = new QFormulaCollection();
            FormulaInfo        y = x.NewRow();

            y.PdStruct = "";
            x.Add(y);
        }
示例#2
0
        private static void pmGetItemofFormula(string inFormula)
        {
            string strErrorMsg = "";

            mCurrFM = inFormula;

            toSQLHelper.SetPara(new object[] { inFormula });
            if (toSQLHelper.SQLExec(ref dtsTem, "QFormula", MapTable.Table.Formula, "select * from " + MapTable.Table.Formula + " where FCSKID = ? ", ref strErrorMsg))
            {
                mCurrQcFM = dtsTem.Tables["QFormula"].Rows[0]["fcCode"].ToString();
            }

            toSQLHelper.SetPara(new object[] { "C", inFormula });
            if (toSQLHelper.SQLExec(ref dtsTem, "QPdStruct", MapTable.Table.PdStruct, "select * from " + MapTable.Table.PdStruct + " where FCTYPE = ? and FCFORMULAS = ? order by FCSEQ", ref strErrorMsg))
            {
                foreach (DataRow dtrTemPdSt in dtsTem.Tables["QPdStruct"].Rows)
                {
                    FormulaInfo mInfo = tmFormula.NewRow();

                    mInfo.PdStruct   = dtrTemPdSt["fcSkid"].ToString();
                    mInfo.RefPdType  = dtrTemPdSt["fcProdOrFo"].ToString();
                    mInfo.PdOrFM     = dtrTemPdSt["fcCompo"].ToString();
                    mInfo.Qty        = Convert.ToDecimal(dtrTemPdSt["fnQty"]) * mRefQty;
                    mInfo.UM         = dtrTemPdSt["fcUm"].ToString();
                    mInfo.UMQty      = Convert.ToDecimal(dtrTemPdSt["fnUmQty"]);
                    mInfo.RootFM     = mRootFM;
                    mInfo.ParentFM   = mCurrFM;
                    mInfo.ParentQcFM = mCurrQcFM;

                    tmFormula.Add(mInfo);

                    mRefQty = Convert.ToDecimal(dtrTemPdSt["fnQty"]);

                    if (mInfo.RefPdType == "F")
                    {
                        string  strSavCurr = mCurrFM;
                        decimal decSaveQty = mRefQty;
                        pmGetItemofFormula(mInfo.PdOrFM);
                        mCurrFM = strSavCurr;
                        mRefQty = decSaveQty;
                    } // if
                }     // foreach
            }         //if
        }