Exemple #1
0
        private IEnumerable <ObjInfo> GetTreeNodes(string guid)
        {
            var res = new List <ObjInfo>();

            try
            {
                var server = _mFilesVaultService.GetServer();
                Log.Info("GetTreeNodes-server Ip:" + server.Ip);
                var app = MFServerUtility.ConnectToServer(server);
                Log.Info("GetTreeNodes-vault Guid:" + guid);
                var vault = app.LogInToVault(guid);
                var units = MFModelUtil.GetUnits(vault).ToList();
                res.AddRange(units);
                foreach (ObjInfo u in units)
                {
                    var floors = MFModelUtil.GetFloors(vault, u.ID).ToList();
                    res.AddRange(floors);
                    foreach (ObjInfo f in floors)
                    {
                        var majors = MFModelUtil.GetDisciplines(vault, f.ID).ToList();
                        res.AddRange(majors);
                    }
                }

                vault.LogOutSilent();
                app.Disconnect();
            }
            catch (Exception ex)
            {
                Log.Error("GetTreeNodes:" + ex.Message);
            }
            return(res);
        }
Exemple #2
0
        private IEnumerable <Qa> GetQaList(string guid, string classAlias, string state)
        {
            var res = new List <Qa>();

            try
            {
                var server = _mFilesVaultService.GetServer();
                Log.Info("GetQaList-server Ip:" + server.Ip);
                var userName = AuthUtility.GetUserName(User);
                Log.Info("GetQaList-userName:"******"GetQaList-password:"******"GetQaList-vault Guid:" + guid);
                var vault = app.LogInToVault(guid);
                var qas   = MFModelUtil.GetQaList(vault, classAlias, state).ToList();
                Log.Info("GetQaList-qas Count:" + qas.Count);
                res.AddRange(qas);
                vault.LogOutSilent();
                app.Disconnect();
            }
            catch (Exception ex)
            {
                Log.Error("GetQaList:" + ex.Message);
            }
            return(res);
        }