Example #1
0
        private string getPT(string ServiceName)
        {
            string pt = "";

            if (!string.IsNullOrEmpty((string)Session["pgtId"]))
            {
                pt = GetProxyTicketFromCAS(ServiceName, (string)Session["pgtId"]);
                if (!String.IsNullOrEmpty(pt))
                {
                    return(pt);
                }
            }

            string pgtiou = UserController.GetUserById(PortalId, UserId).Profile.GetPropertyValue("GCXPGTIOU");
            string pgt    = "";

            if (!string.IsNullOrEmpty(pgtiou))
            {
                try
                {
                    pgt = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    HttpContext.Current.Session.Add("pgtId", pgt);
                }
                catch {}
            }
            pt = GetProxyTicketFromCAS(ServiceName, pgt);

            Session.Add("PT-" + MyCountries.SelectedItem.Text, pt);
            return(pt);
        }
Example #2
0
        private string GetProxyGrantingTicket(string server, string restServer, string service)
        {
            string returnPgt;

            try
            {
                returnPgt = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", _pgtIou);
            }
            catch
            {
                returnPgt = string.Empty;
            }

            if (string.IsNullOrEmpty(returnPgt))
            {
                returnPgt = string.Empty;
            }
            return(returnPgt);
        }
Example #3
0
        private void IdentifyViaGCXTNT()
        {
            if ((Session["TntSummary"] == null) || ((myAccounts)Session["TntSummary"]).Countries == null)
            {
                string pgtiou = UserController.GetUserById(_portalID, _userId).Profile.GetPropertyValue("GCXPGTIOU");

                if (!string.IsNullOrEmpty(pgtiou))
                {
                    try
                    {
                        _pgtId = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    }
                    catch (Exception e)
                    {
                        _pgtId = string.Empty;
                    }

                    if (!string.IsNullOrEmpty(_pgtId))
                    {
                        _myAccounts = _tnt.GetSummary(_pgtId, _ssoGuid);
                        if (_myAccounts.Status == true)
                        {
                            Session["TntSummary"] = _myAccounts;
                        }
                        else
                        {
                            //PGT TICKET HAS EXPIRED!!! Need to re-authenticate...

                            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.LoginTabId) + "?returnurl=" + DotNetNuke.Common.Globals.NavigateURL());
                        }
                    }
                }
            }
            else
            {
                _myAccounts = ((myAccounts)Session["TntSummary"]);
            }
        }
Example #4
0
    private void setPgtId()
    {
        string pgtiou = UserController.GetUserById(_portalId, _userId).Profile.GetPropertyValue("GCXPGTIOU");

        if (!string.IsNullOrEmpty(pgtiou))
        {
            try
            {
                _pgtId = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                HttpContext.Current.Session.Add("pgtId", _pgtId);
            }
            catch
            {
                _pgtId = string.Empty;
            }

            //KeyUser.KeyUser kUser = new KeyUser.KeyUser(new Guid("de4f5f1a-faf8-db81-ad4b-9e4244aabad7"), new Guid("3181c762-195d-4229-817e-c8f665ff3aa4"));
            //_pgtId = kUser.ProxyTicket;  //= null;
        }
        else
        {
            _pgtId = string.Empty;
        }
    }
        private string getPT(string ServiceName)
        {
            string pt = "";
            if (!string.IsNullOrEmpty((string)Session["pgtId"]))
            {
                 pt= GetProxyTicketFromCAS(ServiceName, (string)Session["pgtId"]);
                if (!String.IsNullOrEmpty(pt))
                 return pt;
            }

            string pgtiou = UserController.GetUserById(PortalId , UserId).Profile.GetPropertyValue("GCXPGTIOU");
            string pgt = "";
            if (!string.IsNullOrEmpty(pgtiou))
            {
                try
                {
                    pgt = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    HttpContext.Current.Session.Add("pgtId", pgt);
                }
                catch {}

            }
             pt = GetProxyTicketFromCAS(ServiceName,  pgt);

            Session.Add("PT-" + MyCountries.SelectedItem.Text, pt);
            return pt;
        }
        private string GetProxyGrantingTicket(string server, string restServer, string service)
        {
            string returnPgt;

            try
            {
                returnPgt = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", _pgtIou);
            }
            catch
            {
                returnPgt = string.Empty;
            }

            if (string.IsNullOrEmpty(returnPgt))
            {
                returnPgt = string.Empty;
            }
            return returnPgt;
        }
Example #7
0
    private void setPgtId()
    {
        string pgtiou = UserController.GetUserById(_portalId, _userId).Profile.GetPropertyValue("GCXPGTIOU");

        if (!string.IsNullOrEmpty(pgtiou))
        {
            try
            {
                _pgtId = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                HttpContext.Current.Session.Add("pgtId",_pgtId);
            }
            catch
            {
                _pgtId = string.Empty;
            }

            //KeyUser.KeyUser kUser = new KeyUser.KeyUser(new Guid("de4f5f1a-faf8-db81-ad4b-9e4244aabad7"), new Guid("3181c762-195d-4229-817e-c8f665ff3aa4"));
            //_pgtId = kUser.ProxyTicket;  //= null;
        }
        else
        {
            _pgtId = string.Empty;
        }
    }
Example #8
0
    public static double getAccountBalance(string GUID, string PGTIOU, string CountryURL, string AccountCode)
    {
        string PGTID = (string) HttpContext.Current.Session["pgtId"] ;
        if(PGTID==null)
            PGTID = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", PGTIOU);

        HttpContext.Current.Session.Add("pgtId", PGTID) ;
        var dTnT =  new dynamicTnT.TntMPDDataServerWebService ();
        dTnT.Url = CountryURL + "dataquery/dataqueryservice.asmx";
        dTnT.Discover();
        string sessionId = (string)HttpContext.Current.Session["TnT-" +  dTnT.Url];
        if (string.IsNullOrEmpty(sessionId))
        {
                string service =  dTnT.GetServiceName();
                string pt = GetProxyTicketFromCAS(service, PGTID);
                string UserName;
                bool IsReg;
                sessionId = dTnT.Login(service, pt,  true, out UserName, out IsReg);
                HttpContext.Current.Session.Add("TnT-" +  dTnT.Url, sessionId);
        }
        var resp = dTnT.GetStaffProfiles(sessionId);
        foreach( var prof in resp)
        {
             dynamicTnT.FinancialAccount[] fa  ;
            bool isT;
          var desg=  dTnT.GetStaffProfileSummary(sessionId, prof.Code,out fa,out  isT );
            var mycodes= fa.Where(x => x.Code==AccountCode);
            if( mycodes.Count() >0)
                return (double) mycodes.First().EndingBalance ;

        }

        return 0;

           //     tntTransactions = dTnT.GetFinancialTransactions(sessionId, MyProfiles.SelectedValue, _startDate, _endDate, (MyAccounts.SelectedValue == "All Accounts" ? "" : MyAccounts.SelectedValue), false, out tntAccounts);
           //     StartingBalance.Text = tntAccounts.Sum(x => x.BeginningBalance).ToString("0");

           //mvds.Url = CountryURL + "dataquery/dataqueryservice.asmx";
           // mvds.Discover() ;
           // string service = mvds.GetServiceName(
           // var x = mvds.login(

           // myAccounts acs = new MinistryViewDSServices().GetSummary(PGTID, GUID);
           // var ctry = acs.Countries.Where<Country>(c => c.URL == CountryURL) ;

           // if(ctry.Count()>0)
           // {
           //     var pFiles = from c in ctry.First().Profiles where c.Accounts.Any(ac => ac.AccountID == AccountCode) select c ;
           //     if (pFiles.Count()>0)
           //     {
           //         var Acct = from c in pFiles.First().Accounts where c.AccountID==AccountCode select c.Balance ;
           //         if (Acct.Count()>0)
           //             return Acct.First();
           //     }

           // }
           // return 0.0;
    }
Example #9
0
    static public double getAccountBalance(string GUID, string PGTIOU, string CountryURL, string AccountCode)
    {
        string PGTID = (string)HttpContext.Current.Session["pgtId"];

        if (PGTID == null)
        {
            PGTID = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", PGTIOU);
        }

        HttpContext.Current.Session.Add("pgtId", PGTID);
        var dTnT = new dynamicTnT.TntMPDDataServerWebService();

        dTnT.Url = CountryURL + "dataquery/dataqueryservice.asmx";
        dTnT.Discover();
        string sessionId = (string)HttpContext.Current.Session["TnT-" + dTnT.Url];

        if (string.IsNullOrEmpty(sessionId))
        {
            string service = dTnT.GetServiceName();
            string pt      = GetProxyTicketFromCAS(service, PGTID);
            string UserName;
            bool   IsReg;
            sessionId = dTnT.Login(service, pt, true, out UserName, out IsReg);
            HttpContext.Current.Session.Add("TnT-" + dTnT.Url, sessionId);
        }
        var resp = dTnT.GetStaffProfiles(sessionId);

        foreach (var prof in resp)
        {
            dynamicTnT.FinancialAccount[] fa;
            bool isT;
            var  desg    = dTnT.GetStaffProfileSummary(sessionId, prof.Code, out fa, out isT);
            var  mycodes = fa.Where(x => x.Code == AccountCode);
            if (mycodes.Count() > 0)
            {
                return((double)mycodes.First().EndingBalance);
            }
        }

        return(0);

        //     tntTransactions = dTnT.GetFinancialTransactions(sessionId, MyProfiles.SelectedValue, _startDate, _endDate, (MyAccounts.SelectedValue == "All Accounts" ? "" : MyAccounts.SelectedValue), false, out tntAccounts);
        //     StartingBalance.Text = tntAccounts.Sum(x => x.BeginningBalance).ToString("0");



        //mvds.Url = CountryURL + "dataquery/dataqueryservice.asmx";
        // mvds.Discover() ;
        // string service = mvds.GetServiceName(
        // var x = mvds.login(

        // myAccounts acs = new MinistryViewDSServices().GetSummary(PGTID, GUID);
        // var ctry = acs.Countries.Where<Country>(c => c.URL == CountryURL) ;

        // if(ctry.Count()>0)
        // {
        //     var pFiles = from c in ctry.First().Profiles where c.Accounts.Any(ac => ac.AccountID == AccountCode) select c ;
        //     if (pFiles.Count()>0)
        //     {
        //         var Acct = from c in pFiles.First().Accounts where c.AccountID==AccountCode select c.Balance ;
        //         if (Acct.Count()>0)
        //             return Acct.First();
        //     }


        // }
        // return 0.0;
    }
        private void IdentifyViaGCXTNT()
        {
            if ((Session["TntSummary"] == null) || ((myAccounts)Session["TntSummary"]).Countries  == null)
            {
                string pgtiou = UserController.GetUserById(_portalID, _userId).Profile.GetPropertyValue("GCXPGTIOU");

                if (!string.IsNullOrEmpty(pgtiou)  )
                {
                    try
                    {
                        _pgtId = new theKeyProxyTicket.PGTCallBackSoapClient().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    }
                    catch (Exception e)
                    {
                        _pgtId = string.Empty;
                    }

                    if (!string.IsNullOrEmpty(_pgtId))
                    {
                        _myAccounts = _tnt.GetSummary(_pgtId, _ssoGuid);
                        if (_myAccounts.Status == true)
                            Session["TntSummary"] = _myAccounts;
                        else
                        {
                            //PGT TICKET HAS EXPIRED!!! Need to re-authenticate...

                           Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.LoginTabId) + "?returnurl=" + DotNetNuke.Common.Globals.NavigateURL());

                        }
                    }
                }
            }
            else
            {

                _myAccounts = ((myAccounts)Session["TntSummary"]);
            }
        }