Example #1
0
 public static bool GetUserName(string userNumber, string password, out string userName, out string msg)
 {
     Tafel.MES.MESUser user = new Tafel.MES.MESUser
     {
         UserNumber  = userNumber,
         UserPwd     = password,
         MachineNo   = Current.Tester.Number,
         ProcessCode = Current.Option.CurrentProcessCode,
         StationCode = Current.Option.CurrentStationCode
     };
     return(Tafel.MES.MES.CheckUser(user, out userName, out msg));
 }
Example #2
0
        public static bool CheckUser(MESUser user, out string name, out string msg)
        {
            name = string.Empty;
            string     xml = GetXML("MESUser", new string[] { "UserNumber=" + user.UserNumber, "UserPwd=" + user.UserPwd, "ProcessCode=" + user.ProcessCode, "StationCode=" + user.StationCode, "MachineNo=" + user.MachineNo });
            ServiceAPI ws  = new ServiceAPI();

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

            if (string.IsNullOrEmpty(name))
            {
                name = user.UserNumber;
            }

            return(b);
        }