예제 #1
0
 /// <summary>
 ///  Parent Constructor.
 /// </summary>
 /// <param name="workorderoperation"></param>
 /// <param name="workorder"></param>
 public MVAMFGMWorkOrderComponent(MVAMFGMWorkOrderOperation workorderoperation, MVAMFGMWorkOrder workorder)
     : this(workorderoperation.GetCtx(), 0, workorderoperation.Get_TrxName())
 {
     if (workorderoperation.Get_ID() == 0)
     {
         throw new Exception("Header not saved");
     }
     SetVAMFG_M_WorkOrderOperation_ID(workorderoperation.GetVAMFG_M_WorkOrderOperation_ID()); //	parent
     SetWorkOrder(workorder);
 }                                                                                            //	MWorkOrderComponent
예제 #2
0
        }       //	getOfWorkOrder

        /// <summary>
        ///  Get Components of a Work Order Operation
        /// </summary>
        /// <param name="workorderoperation"></param>
        /// <param name="whereClause"></param>
        /// <param name="orderClause"></param>
        /// <returns></returns>
        public static MVAMFGMWorkOrderComponent[] GetOfWorkOrderOperation(MVAMFGMWorkOrderOperation workorderoperation, String whereClause, String orderClause)
        {
            StringBuilder sqlstmt = new StringBuilder("SELECT * FROM VAMFG_M_WorkOrderComponent WHERE VAMFG_M_WorkOrderOperation_ID=@param1 ");

            if (whereClause != null)
            {
                sqlstmt.Append("AND ").Append(whereClause);
            }
            if (orderClause != null)
            {
                sqlstmt.Append(" ORDER BY ").Append(orderClause);
            }
            String sql = sqlstmt.ToString();
            //ArrayList<MWorkOrderComponent> list = new ArrayList<MWorkOrderComponent>();
            List <MVAMFGMWorkOrderComponent> list = new List <MVAMFGMWorkOrderComponent>();

            SqlParameter[] param = null;
            IDataReader    idr   = null;
            DataTable      dt    = new DataTable();

            //PreparedStatement pstmt = DB.prepareStatement (sql, workorderoperation.get_Trx());
            //ResultSet rs = null;
            try
            {
                param    = new SqlParameter[1];
                param[0] = new SqlParameter("@param1", workorderoperation.GetVAMFG_M_WorkOrderOperation_ID());
                idr      = DB.ExecuteReader(sql, param, workorderoperation.Get_TrxName());
                dt.Load(idr);
                if (idr != null)
                {
                    idr.Close();
                    idr = null;
                }
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    list.Add(new MVAMFGMWorkOrderComponent(workorderoperation.GetCtx(), dt.Rows[i], workorderoperation.Get_TrxName()));
                }
            }
            catch
            {
                if (idr != null)
                {
                    idr.Close();
                    idr = null;
                }
                log.Log(Level.SEVERE, sql);
                return(null);
            }

            MVAMFGMWorkOrderComponent[] retValue = new MVAMFGMWorkOrderComponent[list.Count];
            retValue = list.ToArray();
            return(retValue);
        }       //	getOfWorkOrderOperation
예제 #3
0
        /// <summary>
        /// Constructor called from BOM Drop
        /// </summary>
        /// <param name="workorder"></param>
        /// <param name="workorderoperation"></param>
        /// <param name="product"></param>
        /// <param name="QtyRequired"></param>
        /// <param name="SupplyType"></param>
        /// <param name="locator"></param>
        public MVAMFGMWorkOrderComponent(ViennaAdvantage.Model.MVAMFGMWorkOrder workorder, MVAMFGMWorkOrderOperation workorderoperation, ViennaAdvantage.Model.MProduct product, Decimal QtyRequired,
                                         String SupplyType, int M_AttributeSetInstance_ID, VAdvantage.Model.MLocator locator)
            : this(workorderoperation.GetCtx(), 0, workorderoperation.Get_TrxName())
        {
            if (workorderoperation.Get_ID() == 0)
            {
                throw new Exception("Header not saved");
            }
            SetVAMFG_M_WorkOrderOperation_ID(workorderoperation.GetVAMFG_M_WorkOrderOperation_ID());    //	parent
            SetM_Product_ID(product.GetM_Product_ID());
            SetC_UOM_ID(product.GetC_UOM_ID());
            SetVAMFG_QtyRequired(QtyRequired);
            SetVAMFG_SupplyType(SupplyType);
            // Changes done b y Vivek Kumar assigned by Mukesh on 16/11/2017
            // Changes done to save AttributesetInstance at Work Order component
            SetM_AttributeSetInstance_ID(M_AttributeSetInstance_ID);
            if (locator != null)
            {
                SetM_Locator_ID(locator.GetM_Locator_ID());
            }

            SetWorkOrder(workorder);
        }