Beispiel #1
0
        }       //	setResponseText

        /// <summary>
        ///     Process Request.
        /// </summary>
        /// <returns>answer</returns>
        public String Process()
        {
            MIssueProject.Get(this);            //	sets also Asset
            MIssueSystem.Get(this);
            MIssueUser.Get(this);
            //
            //	setR_IssueKnown_ID(0);
            //	setR_Request_ID(0);
            return(CreateAnswer());
        }       //	process
Beispiel #2
0
        /// <summary>
        /// Get/Set User for Issue
        /// </summary>
        /// <param name="issue">issue</param>
        /// <returns>user</returns>
        static public MIssueUser Get(MIssue issue)
        {
            if (issue.GetUserName() == null)
            {
                return(null);
            }
            MIssueUser user = null;
            //	Find Issue User
            String sql = "SELECT * FROM R_IssueUser WHERE UserName=@param";

            SqlParameter[] param = new SqlParameter[1];
            IDataReader    idr   = null;

            try
            {
                //pstmt = DataBase.prepareStatement (sql, null);
                //pstmt.setString (1, issue.getUserName());
                param[0] = new SqlParameter("@param", issue.GetUserName());
                idr      = DataBase.DB.ExecuteReader(sql, param, null);
                if (idr.Read())
                {
                    user = new MIssueUser(issue.GetCtx(), idr, null);
                }
                idr.Close();
            }
            catch (Exception e)
            {
                if (idr != null)
                {
                    idr.Close();
                }
                _log.Log(Level.SEVERE, sql, e);
            }

            //	New
            if (user == null)
            {
                user = new MIssueUser(issue.GetCtx(), 0, null);
                user.SetUserName(issue.GetUserName());
                user.SetAD_User_ID();
                if (!user.Save())
                {
                    return(null);
                }
            }

            issue.SetR_IssueUser_ID(user.GetR_IssueUser_ID());
            return(user);
        }       //	MIssueUser