} // 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
/// <summary> /// Get/Set System /// </summary> /// <param name="issue">issue</param> /// <returns>system</returns> static public MIssueSystem Get(MIssue issue) { if (issue.GetDBAddress() == null) { return(null); } MIssueSystem system = null; SqlParameter[] param = new SqlParameter[1]; IDataReader idr = null; String sql = "SELECT * FROM R_IssueSystem WHERE DBAddress=@param"; try { //pstmt = DataBase.prepareStatement (sql, null); //pstmt.setString (1, issue.getDBAddress()); param[0] = new SqlParameter("@param", issue.GetDBAddress()); idr = DataBase.DB.ExecuteReader(sql, param, null); if (idr.Read()) { system = new MIssueSystem(issue.GetCtx(), idr, null); } idr.Close(); } catch (Exception e) { if (idr != null) { idr.Close(); } _log.Log(Level.SEVERE, sql, e); } // New if (system == null) { system = new MIssueSystem(issue.GetCtx(), 0, null); system.SetDBAddress(issue.GetDBAddress()); system.SetA_Asset_ID(issue.GetA_Asset_ID()); } system.SetSystemStatus(issue.GetSystemStatus()); system.SetStatisticsInfo(issue.GetStatisticsInfo()); system.SetProfileInfo(issue.GetProfileInfo()); if (issue.GetA_Asset_ID() != 0 && system.GetA_Asset_ID() != issue.GetA_Asset_ID()) { system.SetA_Asset_ID(issue.GetA_Asset_ID()); } // if (!system.Save()) { return(null); } // Set issue.SetR_IssueSystem_ID(system.GetR_IssueSystem_ID()); if (system.GetA_Asset_ID() != 0) { issue.SetA_Asset_ID(system.GetA_Asset_ID()); } return(system); } // get