コード例 #1
0
        public static ClsModuleCollection GetOnlyCollMod()
        {
            try
            {
                ClsModuleCollection obj = new ClsModuleCollection();

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    try
                    {
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                        }
                    }

                    #region Catch Block
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetOnlyCollMod(int intRoleId)", "ClsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                        }
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetOnlyCollMod(int intRoleId)", "ClsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                        }
                    }
                    #endregion
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        try
                        {
                            if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                            }
                            else
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                            }
                        }

                        #region Catch Block
                        catch (System.ServiceModel.EndpointNotFoundException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "GetOnlyCollMod(int intRoleId)", "ClsModuleCollection.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                            }
                            else
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                            }
                        }
                        catch (System.ServiceModel.CommunicationException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "GetOnlyCollMod(int intRoleId)", "ClsModuleCollection.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                            }
                            else
                            {
                                obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,ClassName,AssemblyFile from Module where IsCollaborative='true' and NeedsAuthentication='true' order by ModuleName").dsInfo);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        obj.MapObjects(new ClsModuleDataService().GetOnlyCollaborativeModules());
                    }
                }
                return(obj);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetOnlyCollMod()", "ClsModuleCollection.cs");
                return(null);
            }
        }
コード例 #2
0
        public static ClsModuleCollection GetCMod(int intRoleId)
        {
            try
            {
                ClsModuleCollection obj = new ClsModuleCollection();

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pRoleId";
                    objInfo.PValue    = intRoleId;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;
                    lstSP.Add(objInfo);

                    clsSqlParametersInfo objVersionInfo = new clsSqlParametersInfo();
                    objVersionInfo.Direction = "Input";
                    objVersionInfo.PName     = "@pVersion";
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                    {
                        objVersionInfo.PValue = "1.0.%";
                    }
                    else
                    {
                        objVersionInfo.PValue = " ";
                    }
                    objVersionInfo.PDBType = "varchar";
                    objVersionInfo.PSize   = 10;
                    lstSP.Add(objVersionInfo);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;

                    try
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetCMod(int intRoleId)", "ClsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetCMod(int intRoleId)", "ClsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                    }
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                        clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                        objInfo.Direction = "Input";
                        objInfo.PName     = "@pRoleId";
                        objInfo.PValue    = intRoleId;
                        objInfo.PDBType   = "BigInt";
                        objInfo.PSize     = 200;
                        lstSP.Add(objInfo);

                        clsSqlParametersInfo objVersionInfo = new clsSqlParametersInfo();
                        objVersionInfo.Direction = "Input";
                        objVersionInfo.PName     = "@pVersion";
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            objVersionInfo.PValue = "1.0.%";
                        }
                        else
                        {
                            objVersionInfo.PValue = " ";
                        }
                        objVersionInfo.PDBType = "varchar";
                        objVersionInfo.PSize   = 10;
                        lstSP.Add(objVersionInfo);

                        clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                        CSqlInfo.objParam = lstSP;

                        try
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                        }
                        catch (System.ServiceModel.EndpointNotFoundException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "GetCMod(int intRoleId)", "ClsModuleCollection.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                        }
                        catch (System.ServiceModel.CommunicationException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "GetCMod(int intRoleId)", "ClsModuleCollection.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModules", CSqlInfo).dsInfo);
                        }
                    }
                    else
                    {
                        obj.MapObjects(new ClsModuleDataService().GetCollaborativeModules(intRoleId));
                    }
                }
                return(obj);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetCMod()", "ClsModuleCollection.cs");
                return(null);
            }
        }