示例#1
0
        private SmartwatchInfo GetSmartWatchUser(string macAddress)
        {
            var smartwatchInfo = new SmartwatchInfo
            {
                User     = string.Empty,
                Password = string.Empty
            };

            return(smartwatchInfo);
        }
示例#2
0
        public CallMaterialResponse CallMaterial(CallMaterialRequest materialCall)
        {
            SmartwatchInfo          userInfo = GetSmartWatchUser(materialCall.MacAddress);
            SendMaterialCallRequest request  = new SendMaterialCallRequest
            {
                User      = userInfo.User,
                Password  = userInfo.Password,
                Equipment = userInfo.Equipment
            };
            var response = SendMaterialCall(request);

            return(new CallMaterialResponse
            {
                Error = response.Error,
                Succeeded = response.Succeeded
            });
        }
示例#3
0
        private SmartwatchInfo GetSmartWatchUser(string macAddress)
        {
            var smartwatchInfo = new SmartwatchInfo
            {
                User     = string.Empty,
                Password = string.Empty
            };
            var      smartWatchConfig = XDocument.Load(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "\\SmartWatchConfig.xml");
            XElement user             = smartWatchConfig.Root.Elements("SmartWatch").FirstOrDefault(s => s.Attribute("MacAddress").Value.Equals(macAddress));

            if (user != null)
            {
                smartwatchInfo.User      = user.Element("User").Value;
                smartwatchInfo.Password  = user.Element("Password").Value;
                smartwatchInfo.Equipment = user.Element("Equipment").Value;
                smartwatchInfo.WorkArea  = user.Element("WorkArea").Value;
            }
            return(smartwatchInfo);
        }