示例#1
0
        /// <summary>
        /// convert part model to part quantity master for update
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public IV00102_Part_Quantity_Master ConvertToUpdatePartQuantity(PartOperationModel model)
        {
            IV00102_Part_Quantity_Master partQuantity = new IV00102_Part_Quantity_Master();

            partQuantity.ITEMNMBR = model.PartNumber;
            partQuantity.PRIMVNDR = model.FoundryId;

            return(partQuantity);
        }
示例#2
0
        /// <summary>
        /// get part quantity master by item Number
        /// </summary>
        /// <param name="itemNumber"></param>
        /// <returns></returns>
        public IV00102_Part_Quantity_Master GetPartQuantityMaster(string itemNumber)
        {
            var part = new IV00102_Part_Quantity_Master();

            try
            {
                part = _dynamicsContext.IV00102_Part_Quantity_Master.FirstOrDefault(x => x.ITEMNMBR.Replace(" ", string.Empty).ToLower() == itemNumber.Replace(" ", string.Empty).ToLower());
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Error getting quantity master part: {0} ", ex.ToString());
            }

            return(part);
        }