/// <summary>
        /// Inserts point of sales call data into database
        /// </summary>
        /// <param name="request"></param>
        private void InsertPosCallLog(LspRequest request)
        {
            var posCallLog = new PosCallLog
                {
                    DateCreated = DateTime.Now,
                    CoopStoreId = request.CoopStoreId,
                    HostName = request.HostName,
                    IpAddress = request.IpAddress,
                    PackageVersionId = request.PackageVersionId,
                    PosManufacturerName = request.PosManufacturerName,
                    PosNumber = request.PosNumber,
                    PosVersion = request.PosVersion,
                    TerminalSerialNumber = request.TerminalSerialNumber
                };
            var posCallLogId = _posCallLogDao.Save(posCallLog);

            if (posCallLog.PosAssemblyLogs != null)
            {
                foreach (var assembly in request.AssemblyInfos)
                {
                    _posAssemblyLogDao.Save(new PosAssemblyLog { AssemblyName = assembly.AssemblyName, AssemblyVersion = assembly.AssemblyVersion, PosCallLogId = posCallLogId});
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public static PosCallLog BuildPosCallLog(ISession session)
        {
            var posCallLog = new PosCallLog
            {
                DateCreated = DateTime.Now,
                CoopStoreId = 22,
                HostName = "I am the first host!",
                IpAddress = "123.3.4.5",
                PosManufacturerName = "R2M",
                PosNumber = "123456789",
                PosVersion = "5.0.0.1",
                TerminalSerialNumber = "556667778899"
            };

            posCallLog.PosAssemblyLogs.Add(new PosAssemblyLog { AssemblyName = "I am assembly 1", AssemblyVersion = "7.5.6" });
            posCallLog.PosAssemblyLogs.Add(new PosAssemblyLog { AssemblyName = "I am assembly 2", AssemblyVersion = "9.1.3" });

            var packageVersion = AddPackageVersion(session);
            posCallLog.PackageVersionId = packageVersion.Id;

            return posCallLog;
        }