コード例 #1
0
        /**
         *  Get Measure Display Text
         *	@return Measure Display Text
         */
        public String GetXAxisText()
        {
            MMeasure measure = GetMeasure();

            if (measure != null &&
                MMeasure.MEASUREDATATYPE_StatusQtyAmount.Equals(measure.GetMeasureDataType()))
            {
                if (MMeasure.MEASURETYPE_Request.Equals(measure.GetMeasureType()))
                {
                    return(Msg.GetElement(GetCtx(), "R_Status_ID"));
                }
                if (MMeasure.MEASURETYPE_Project.Equals(measure.GetMeasureType()))
                {
                    return(Msg.GetElement(GetCtx(), "C_Phase_ID"));
                }
            }
            String value   = GetMeasureDisplay();
            String display = MRefList.GetListName(GetCtx(), MEASUREDISPLAY_AD_Reference_ID, value);

            return(display == null ? value : display);
        }
コード例 #2
0
        /**
         *  Get Material Cost Element or create it
         *	@param po parent
         *	@param CostingMethod method
         *	@return cost element
         */
        public static MCostElement GetMaterialCostElement(PO po, String CostingMethod)
        {
            if (CostingMethod == null || CostingMethod.Length == 0)
            {
                _log.Severe("No CostingMethod");
                return(null);
            }
            //
            MCostElement retValue = null;
            String       sql      = "SELECT * FROM M_CostElement WHERE AD_Client_ID=" + po.GetAD_Client_ID() + " AND CostingMethod=@costingMethod ORDER BY AD_Org_ID";
            DataTable    dt       = null;
            IDataReader  idr      = null;

            try
            {
                SqlParameter[] param = new SqlParameter[1];
                param[0] = new SqlParameter("@costingMethod", CostingMethod);

                idr = DataBase.DB.ExecuteReader(sql, param, po.Get_TrxName());
                dt  = new DataTable();
                dt.Load(idr);
                idr.Close();

                //bool n = dr.next(); //jz to fix DB2 resultSet closed problem
                //if (n)
                foreach (DataRow dr in dt.Rows)
                {
                    retValue = new MCostElement(po.GetCtx(), dr, po.Get_TrxName());
                }
                //if (n && dr.next())
                //    s_log.warning("More then one Material Cost Element for CostingMethod=" + CostingMethod);
            }
            catch (Exception e)
            {
                if (idr != null)
                {
                    idr.Close();
                }
                _log.Log(Level.SEVERE, sql, e);
            }
            finally
            {
                dt = null;
            }

            if (retValue != null)
            {
                return(retValue);
            }

            //	Create New
            retValue = new MCostElement(po.GetCtx(), 0, po.Get_TrxName());
            retValue.SetClientOrg(po.GetAD_Client_ID(), 0);
            String name = MRefList.GetListName(po.GetCtx(), COSTINGMETHOD_AD_Reference_ID, CostingMethod);

            if (name == null || name.Length == 0)
            {
                name = CostingMethod;
            }
            retValue.SetName(name);
            retValue.SetCostElementType(COSTELEMENTTYPE_Material);
            retValue.SetCostingMethod(CostingMethod);
            retValue.Save();
            return(retValue);
        }
コード例 #3
0
        }       //	GetCreatedByName

        /**
         *  Get Confidential Entry Text (for jsp)
         *	@return text
         */
        public String GetConfidentialEntryText()
        {
            return(MRefList.GetListName(GetCtx(), CONFIDENTIALTYPEENTRY_AD_Reference_ID, GetConfidentialTypeEntry()));
        }       //	GetConfidentialTextEntry
コード例 #4
0
 /**
  *  Get Name of ConfirmType
  *	@return confirm type
  */
 public String GetConfirmTypeName()
 {
     return(MRefList.GetListName(GetCtx(), CONFIRMTYPE_AD_Reference_ID, GetConfirmType()));
 }