Exemple #1
0
        /// <summary>
        /// Converts the Click ViewModel into a Click Model to be used with the service.
        /// </summary>
        /// <param name="click">ViewModel to convert.</param>
        /// <returns>ClickReturns null if parameter is null. Otherwise, returns Model to be used with the service.</returns>
        public static SP.ClickSvc.Click ToModel(this VM.ClickViewModel click)
        {
            if (null == click) { return null; }

            SP.ClickSvc.Click result = new SP.ClickSvc.Click()
            {
                ClickGuid = click.ClickGuid,
                FacilityGuid = click.FacilityGuid,
                ListingTypeGuid = click.ListingTypeGuid,
                TimeStamp = click.TimeStamp,
            };

            return result;
        }
Exemple #2
0
        public static int InsertClick(Guid facilityGuid, Guid listingTypeGuid, DateTime timeStamp)
        {
            try
            {
                // Create the service proxy object and populate it.
                SP.ClickSvc.Click request = new SP.ClickSvc.Click();

                request.ClickGuid = Guid.Empty;
                request.FacilityGuid = facilityGuid;
                request.ListingTypeGuid = listingTypeGuid;
                request.TimeStamp = timeStamp;

                // Call the service insert method.
                _clickClient.InsertClick(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }