Ejemplo n.º 1
0
        public CUserInfo ValidateUser(string user)
        {
            CUserInfo userinfo = new CUserInfo();

            try
            {
                Log.WriteLog(user, System.Diagnostics.EventLogEntryType.Information);

                Plt.IComosDUser userobject = m_ComosSession.GetUserInfo(user);

                if (userobject != null)
                {
                    userinfo.UserUID = userobject.SystemUID();
                    userinfo.Name    = userobject.Name;

                    if (userobject.GetRemark(5) != "")
                    {
                        Plt.IComosDWorkset workset = (Plt.IComosDWorkset)userobject.Workset();
                        Plt.IComosDDevice  objuser = (IComosDDevice)workset.LoadObjectByType(ComosSystemTypes.SystemTypeDevice, userobject.GetRemark(5));

                        if (objuser != null)
                        {
                            userinfo.SystemFullName = objuser.SystemFullName();
                        }
                    }

                    m_ComosSession.SetCurrentUser(user);
                }
                else
                {
                    return(null);
                }

                return(userinfo);
            }
            catch (Exception ex)
            {
                Log.WriteLog(ex.ToString(), System.Diagnostics.EventLogEntryType.Information);
                System.Diagnostics.Debug.WriteLine(ex.Message + ":ValidateUser");
                System.Diagnostics.Debug.Assert(false);
                return(null);
            }
        }