Example #1
0
        /// <summary>
        /// To view model
        /// </summary>
        /// <param name="pObj"></param>
        /// <returns></returns>
        public MAssetsItems ToModel(AssetItem pObj)
        {
            try
            {
                var _model = new MAssetsItems
                {
                    MRID = pObj.MRId,
                    FNAM = pObj.FirstName,
                    LNAM = pObj.LastName,
                    PSTN = pObj.Position,
                    ACOD = pObj.AssetCode,
                    AGRP = pObj.AssetGroup,
                    AIID = pObj.AssetItemId,
                    ANAM = pObj.AssetName,
                    ANUM = pObj.AssetNumber,
                    ASTA = pObj.AssetStatus,
                    ATYP = pObj.AssetType,
                    RMRK = pObj.Remarks,
                    SDAT = pObj.ServiceDate,
                    SNUM = pObj.SerialNumber,
                    UCST = pObj.UnitCost,
                    ULIF = pObj.UsefulLife,
                    QUNT = pObj.Quantity,
                    UMEA = pObj.UnitMeasure
                };

                return(_model);
            }
            catch (Exception ex) { throw ex; }
        }
Example #2
0
 /// <summary>
 /// To binding
 /// </summary>
 /// <param name="pObj"></param>
 /// <returns></returns>
 public AssetItem ToBinding(MAssetsItems pObj)
 {
     try
     {
         var _binding = new AssetItem
         {
             MRId         = pObj.MRID,
             FirstName    = pObj.FNAM,
             LastName     = pObj.LNAM,
             Position     = pObj.PSTN,
             AssetCode    = pObj.ACOD,
             AssetGroup   = pObj.AGRP,
             AssetItemId  = pObj.AIID,
             AssetName    = pObj.ANAM,
             AssetNumber  = pObj.ANUM,
             AssetStatus  = pObj.ASTA,
             AssetType    = pObj.ATYP,
             Remarks      = pObj.RMRK,
             SerialNumber = pObj.SNUM,
             ServiceDate  = pObj.SDAT,
             UnitCost     = pObj.UCST,
             UsefulLife   = pObj.ULIF
         };
         return(_binding);
     }
     catch (Exception ex) { throw ex; }
 }