Пример #1
0
        private string getPT(string ServiceName)
        {
            string pt = "";

            if ((!string.IsNullOrEmpty((string)Session["pgtId"])) && !((string)Session["pgtId"] == "ERROR"))
            {
                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.PGTCallBack().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    HttpContext.Current.Session.Add("pgtId", pgt);
                }
                catch { }
            }
            pt = GetProxyTicketFromCAS(ServiceName, pgt);

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

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

            if (string.IsNullOrEmpty(returnPgt))
            {
                returnPgt = string.Empty;
            }
            return(returnPgt);
        }
Пример #3
0
    private void setPgtId()
    {
        string pgtiou = UserController.GetUserById(_portalId, _userId).Profile.GetPropertyValue("GCXPGTIOU");

        if (!string.IsNullOrEmpty(pgtiou))
        {
            try
            {
                _pgtId = new theKeyProxyTicket.PGTCallBack().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;
        }
    }
Пример #4
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.PGTCallBack().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 string GetProxyGrantingTicket(string server, string restServer, string service)
        {
            string returnPgt;

            try
            {

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

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

        if (!string.IsNullOrEmpty(pgtiou))
        {
            try
            {
                _pgtId = new theKeyProxyTicket.PGTCallBack().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;
        }
    }
    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.PGTCallBack().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;
    }
Пример #8
0
        private string getPT(string ServiceName)
        {
            string pt = "";
            if ( (!string.IsNullOrEmpty((string)Session["pgtId"])) && !((string)Session["pgtId"]=="ERROR"))
            {
                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.PGTCallBack().RetrievePGTCallback("CASAUTH", "thecatsaysmeow3", pgtiou);
                    HttpContext.Current.Session.Add("pgtId", pgt);
                }
                catch { }

            }
            pt = GetProxyTicketFromCAS(ServiceName, pgt);

            Session.Add("PT-" + MyCountries.SelectedItem.Text, pt);
            return pt;
        }