Пример #1
0
        /// <summary>
        /// 反写销售订单行上的项目字段
        /// 入口参数:销售订单行ID集合,项目档案KEY
        /// </summary>
        /// <param name="bpObj"></param>
        public void ModitySoLineProject(ModitySoLineProjectCode bpObj)
        {
            List <long> l = bpObj.SoLineListID;
            Project     p = Project.Finder.Find("ID=@ID", new OqlParam(bpObj.ProjectID));

            if (l != null && l.Count > 0)
            {
                using (ISession session = Session.Open())
                {
                    if (p != null)
                    {
                        for (int i = 0; i < l.Count; i++)
                        {
                            SOLine s = SOLine.Finder.FindByID(l[i]);
                            if (s != null)
                            {
                                s.ProjectKey   = p.Key;
                                s.Project.Code = p.Code;
                                s.Project.Name = p.Name;
                            }
                        }
                    }
                    session.Commit();
                }
            }
        }
Пример #2
0
        public override object Do(object obj)
        {
            ModitySoLineProjectCode bpObj = (ModitySoLineProjectCode)obj;

            if (bpObj != null)
            {
                ModitySoLineProject(bpObj);
            }
            return(true);
        }