Beispiel #1
0
        public static bool UploadMachineState(MachineState ms, out string msg)
        {
            string     xml = GetXML("MachineState", new string[] { "MachineNo=" + ms.MachineNo, "state=" + ms.state, "UserNumber=" + ms.UserNumber });
            ServiceAPI ws  = new ServiceAPI();

#if ISOFFLINE
            string returnXml = @"<?xml version='1.0' encoding='utf-8'?>
                                <response>
                                    <table>
                                        <rows>
                                            <returncode>1</returncode>
                                            <errormsg>OK</errormsg>
                                        </rows>
                                    </table>
                                </response>";
#else
            string returnXml = string.Empty;
            try
            {
                returnXml = ws.Insert_MachineNo(xml);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return(false);
            }
#endif
            bool b = CheckXML(returnXml, out msg);
            if (!string.IsNullOrEmpty(msg))
            {
                LogHelper.WriteError(msg + "xml" + xml);
            }
            return(b);
        }