Esempio n. 1
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RSave(BaseEntity p_BE, BaseEntity[] p_BE2, ArrayList p_BE3, IDBTransAccess sqlTrans)
        {
            try
            {
                //首先处理主表保存
                ItemGY entity      = (ItemGY)p_BE;
                ItemGY entitycheck = new ItemGY(sqlTrans);
                entitycheck.ID = entity.ID;
                if (entitycheck.SelectByID())
                {
                    this.RUpdate(entity, sqlTrans);
                }
                else
                {
                    this.RAdd(entity, sqlTrans);
                }

                //处理明细表及孙表保存
                ItemGYFlowDtsRule dtsrule = new ItemGYFlowDtsRule();
                dtsrule.RSave(entity, p_BE2, p_BE3, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        ItemGY EntityGet()
        {
            ItemGY entity = new ItemGY();

            entity.ID = _WPItemID;
            entity.SelectByID();
            return(entity);
        }