Ejemplo n.º 1
0
        }       //	prepare

        /// <summary>
        /// Process
        /// </summary>
        /// <returns>summary</returns>
        protected override String DoIt()
        {
            log.Info("C_Lead_ID=" + _C_Lead_ID + ",C_ProjectType_ID=" + _C_ProjectType_ID);
            if (_C_Lead_ID == 0)
            {
                throw new Exception("@C_Lead_ID@ ID=0");
            }
            if (_C_ProjectType_ID == 0)
            {
                throw new Exception("@C_ProjectType_ID@ ID=0");
            }

            MLead lead = new MLead(GetCtx(), _C_Lead_ID, Get_TrxName());

            if (lead.Get_ID() != _C_Lead_ID)
            {
                throw new Exception("@NotFound@: @C_Lead_ID@ ID=" + _C_Lead_ID);
            }
            //
            String retValue = lead.CreateProject(_C_ProjectType_ID);

            if (retValue != null)
            {
                throw new SystemException(retValue);
            }
            lead.Save();
            MProject project = lead.GetProject();

            //
            return("@C_Project_ID@ " + project.GetName());
        } //	doIt