예제 #1
0
        public override object Do(object obj)
        {
            GetBomMaster bpObj  = (GetBomMaster)obj;
            bool         IsTrue = false;

            if (bpObj != null)
            {
                GetBomMaster(bpObj);
            }
            return(IsTrue);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="SoLineKey"></param>
        public void GetBomMaster(GetBomMaster bpObj)
        {
            SOLine line = null;

            using (ISession session = Session.Open())
            {
                for (int i = 0; i < bpObj.SOLineKeyID.Count; i++)
                {
                    line = SOLine.Finder.FindByID(bpObj.SOLineKeyID[i].ID);//根据销售订单行ID得到料号[] bpObj.SOLineKeyID[0]
                    //1,生成随单BOM 并返回数据集合
                    //2,根据料品中的业务员字段 生成随单BOM业务员子表
                    if (line != null && line.ItemInfo.ItemCode != null)
                    {
                        Recursion(line.ItemInfo.ItemCode, line, "1", 0);//递归
                    }
                    else
                    {
                        throw new Exception("没用找到对应的料品信息,生成随单BOM失败!");
                    }
                }
                session.Commit();
            }
        }