Beispiel #1
0
        public static ClsPageCollection GetAll()
        {
            try
            {
                ClsPageCollection obj = new ClsPageCollection();

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select pagetitle,id from page where isdeleted='false'").dsInfo);
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select pagetitle,id from page where isdeleted='false'").dsInfo);
                    }
                    else
                    {
                        obj.MapObjects(new ClsPageDataService().GetPages());
                    }
                }
                return(obj);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetAll", "ClsPageCollection.cs");
                return(null);
            }
        }
Beispiel #2
0
        public static ClsPageCollection GetUPageAllocated(int intUserId)
        {
            try
            {
                ClsPageCollection obj = new ClsPageCollection();
                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     = "@pUserID";
                    objInfo.PValue    = intUserId;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    lstSP.Add(objInfo);

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

                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGetUsersPageAllocated", 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     = "@pUserID";
                        objInfo.PValue    = intUserId;
                        objInfo.PDBType   = "BigInt";
                        objInfo.PSize     = 200;

                        lstSP.Add(objInfo);

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

                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGetUsersPageAllocated", CSqlInfo).dsInfo);
                    }
                    else
                    {
                        obj.MapObjects(new ClsPageDataService().GetPageAllocated(intUserId));
                    }
                }
                return(obj);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetUPageAllocated", "ClsPageCollection.cs");
                return(null);
            }
        }