Ejemplo n.º 1
0
 public DynamicDataWebMethodReturnType ViewActivations()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectURL = "~/Sales_LicenseKeyActivations/List.aspx?LicenseKeyId=" + Id.ToString();
        return ret;
 }
Ejemplo n.º 2
0
 public DynamicDataWebMethodReturnType Receivables()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectURL = "~/Accounting_LedgerItems/List.aspx?LedgerType=Receivable&AccountId=" + Id.ToString();
        return ret;
 }
Ejemplo n.º 3
0
 public DynamicDataWebMethodReturnType GeoLocatetheIP()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectURL = "http://www.maxmind.com/app/locate_demo_ip?ips=" + DownloadedByIP;
        return ret;
 }
Ejemplo n.º 4
0
 public DynamicDataWebMethodReturnType Reboot()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.Status = "The server is restarting..";
        ret.Message = "Please wait while your server restarts.";
        ret.Exception = false;
        return ret;
 }
Ejemplo n.º 5
0
 public DynamicDataWebMethodReturnType TurnOffPower()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.Status = "The server is turning off..";
        ret.Message = "Please wait your server is turning off!";
        ret.Exception = false;
        return ret;
 }
Ejemplo n.º 6
0
 public DynamicDataWebMethodReturnType Apply2()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectWidth = 800;
        ret.RedirectHeight = 500;
        ret.RedirectURL = "~/HR_Applications/Details.aspx";
        return ret;
 }
Ejemplo n.º 7
0
 public DynamicDataWebMethodReturnType DownloadPrintablePDF()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.FilePath = GeneratePDF();
        ret.FileMimeType = "application/octet-stream";
        ret.FileName = "Check " + CheckNumber.ToString() + ".pdf";
        //ret.RedirectRequest = true;
        //ret.RedirectURL = "~/Accounting_LedgerItems/List.aspx?AccountId=" + AccountId.ToString() + "&LedgerType=" + LedgerType.ToString();
        return ret;
 }
Ejemplo n.º 8
0
        public DynamicDataWebMethodReturnType TurnOnPower()
        {
            // do the power up

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "The server is turning on..";
               ret.Message = "Please wait while your server spins up.";
               ret.Exception = false;
               return ret;
        }
Ejemplo n.º 9
0
        public DynamicDataWebMethodReturnType Receivables()
        {
            DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.RedirectRequest = true;
               // real url = String.Format("~/{0}/{1}.aspx?Id={2}", TableName, PageTemplate, ObjectId.ToString());

               ret.RedirectURL = Path;
               ret.RedirectWidth = 800;
               ret.RedirectHeight = 500;
               return ret;
        }
Ejemplo n.º 10
0
        public DynamicDataWebMethodReturnType ImportBillPaymentData()
        {
            DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Bill Payment Import Tool";

               var financialAccount = GetAccount();
               if (financialAccount.LedgerType == LedgerType.Checking.ToString())
               {
                    ret.Message = "The import was successful!\r\n\r\nImported/Updated: ";

                    int addedItems = ImportScheduledPayments();
                    ret.Message += addedItems.ToString();
               }
               else
               {
                    ret.Message = "This option can only be used on Checking accounts.";
               }
               return ret;
        }
Ejemplo n.º 11
0
        public DynamicDataWebMethodReturnType UpdateCachedBalances()
        {
            // call UpdateCachedBalances() instead ??

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Balance Update";
               decimal remoteAvailableBalance = 0.0m;
               decimal remoteLedgerBalance = 0.0m;
               bool retrieved = GetBalances(GetAccount(), out remoteAvailableBalance, out remoteLedgerBalance);
               if (retrieved)
               {
                    using (WeavverEntityContainer data = new WeavverEntityContainer())
                    {
                         var ofxSettings = (from x in data.Accounting_OFXSettings
                                            where x.Id == Id
                                            select x).FirstOrDefault();

                         ofxSettings.AvailableBalance = remoteAvailableBalance;
                         ofxSettings.LedgerBalance = remoteLedgerBalance;

                         int changes = data.SaveChanges();
                         if (changes > 0)
                         {
                              ret.Message = "Balances updated.";
                              ret.RefreshData = true;
                              return ret;
                         }
                    }
               }

               ret.Message = "Could not update the balance.";
               return ret;
        }
Ejemplo n.º 12
0
        public DynamicDataWebMethodReturnType TestConnection()
        {
            DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "OFX Check";

               var financialAccount = GetAccount();

               if (financialAccount.LedgerType == LedgerType.Checking.ToString() ||
                   financialAccount.LedgerType == LedgerType.Savings.ToString())
               {
                    nsoftware.InEBank.Account account = new nsoftware.InEBank.Account();
                    account.Firewall.AutoDetect = false;
                    account.Firewall.FirewallType = nsoftware.InEBank.FirewallTypes.fwNone;
                    account.FIUrl = Url;
                    account.FIOrganization = FinancialInstitutionName;
                    account.FIId = FinancialInstitutionId.ToString();
                    account.OFXAppId = "QWIN";
                    account.OFXAppVersion = "1800";
                    account.OFXUser = Username;
                    account.OFXPassword = Password;
                    try
                    {
                         account.GetInfo();

                         ret.Message = "The connection succeeded.";
                    }
                    catch (Exception ex)
                    {
                         ret.Message = "The OFX connection failed: " + ex.Message;
                    }
               }

               if (financialAccount.LedgerType == LedgerType.CreditCard.ToString())
               {
                    Accounting_Accounts ccAccount = GetAccount();

                    nsoftware.InEBank.Ccstatement ccStatement = new nsoftware.InEBank.Ccstatement();
                    ccStatement.OFXAppId = "QWIN";
                    ccStatement.OFXAppVersion = "1800";
                    ccStatement.FIUrl = Url;
                    ccStatement.FIId = FinancialInstitutionId.ToString();
                    ccStatement.FIOrganization = FinancialInstitutionName;
                    ccStatement.CardNumber = ccAccount.AccountNumber;
                    ccStatement.OFXUser = Username;
                    ccStatement.OFXPassword = Password;
                    ccStatement.StartDate = DateTime.Now.Subtract(TimeSpan.FromDays(40)).ToString("MM/dd/yyyy hh:mm:ss");
                    try
                    {
                         ccStatement.GetStatement();

                         ret.Message = "The connection succeeded.";
                    }
                    catch (Exception ex)
                    {
                         ret.Message = "The test connection failed: " + ex.Message;
                    }
               }
               return ret;
        }
Ejemplo n.º 13
0
        public DynamicDataWebMethodReturnType ListAccounts()
        {
            DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               Accounting_Accounts account = GetAccount();

               nsoftware.InEBank.Account remoteAccount = new Account();
               remoteAccount.OFXAppId = "QWIN";
               remoteAccount.OFXAppVersion = "1800";
               remoteAccount.FIUrl = Url;
               remoteAccount.FIId = FinancialInstitutionId.ToString();
               remoteAccount.FIOrganization = FinancialInstitutionName;
               remoteAccount.OFXUser = Username;
               remoteAccount.OFXPassword = Password;

               remoteAccount.GetInfo();

               string acctList = "<br />No accounts found";
               if (remoteAccount.Accounts.Count > 0)
               {
                    acctList = "<br />";
                    foreach (var acct in remoteAccount.Accounts)
                    {
                         acctList += acct.Id;
                         if (!String.IsNullOrEmpty(acct.Description))
                         {
                              acctList += ": " + acct.Description;
                         }
                         acctList += "<br />";
                         acctList += " - Type: " + acct.AccType + "<br />";
                         acctList += " - Status: " + acct.Status + "<br />";
                         acctList += " - Is Checking: " + (acct.Checking ? "yes" : "no") + "<br /><br />";
                    }
               }

               ret.Status = "Remote Account List";
               ret.Message = acctList;
               return ret;
        }
Ejemplo n.º 14
0
        public DynamicDataWebMethodReturnType SendviaBillPay()
        {
            // check if there is an OFX settings record for the selected Funding Source
               // do a search on the server sidepayees for the payeeid
                    // if the payee does not exist, create it and get the payeeid

               // we now have the payeeid

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Not implemented.";
               ret.Message = "Not implemented.";
               return ret;
        }
Ejemplo n.º 15
0
        public DynamicDataWebMethodReturnType GenerateKey()
        {
            ushort ushortserial = ushort.Parse("1"); //i.ToString()//key.Id.ToString());
               //changed sept 7
               string checksum = EncryptedLicense.Checksum(FullName + "|" + Organization);
               //DateTime future = DateTime.UtcNow.Add(TimeSpan.FromDays(365));
               DateTime future = DateTime.UtcNow.Add(TimeSpan.FromDays(545));
               EncryptedLicenseProvider licenseProvider = new EncryptedLicenseProvider();

               string licensekey = licenseProvider.GenerateKey(ConfigurationManager.AppSettings["snap_productkey"], "C" + checksum + "$D" + future.Month.ToString() + "/" + future.Day.ToString() + "/" + future.Year.ToString(), ushortserial);
               //Key = licensekey;

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "License Key";
               ret.Message = "Your license key is:\r\n\r\n";// +licensekey;
               ret.Exception = false;
               return ret;
        }
Ejemplo n.º 16
0
        public DynamicDataWebMethodReturnType ImportLedgerItems()
        {
            DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Import Status";
               using (WeavverEntityContainer data = new WeavverEntityContainer())
               {
                    //data.Accounting_OFXSettings.Attach(this);
                    DateTime startAt = DateTime.Now.Subtract(TimeSpan.FromDays(7));
                    if (LastSuccessfulConnection.HasValue)
                         startAt = LastSuccessfulConnection.Value;

                    List<Accounting_OFXLedgerItem> items = GetRemoteLedgerItems(startAt, DateTime.Now);
                    foreach (var item in items)
                    {
                         if (!item.HasBeenImported)
                         {
                              data.Accounting_LedgerItems.Add(item.LedgerItem);
                         }
                    }
                    LastSuccessfulConnection = DateTime.UtcNow;
                    int results = data.SaveChanges();
                    ret.Message = "Ledger items added/updated: " + results.ToString();
               }
               return ret;
        }
Ejemplo n.º 17
0
        public DynamicDataWebMethodReturnType PushUnbilledItems()
        {
            int periodsBilled = BillAccount(Id);

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Account Billed";
               ret.Message = "Total periods billed: " + periodsBilled.ToString();

               ret.RefreshData = true;
               return ret;
        }
Ejemplo n.º 18
0
 public DynamicDataWebMethodReturnType OFXSettings()
 {
     using (WeavverEntityContainer data = new WeavverEntityContainer())
        {
             DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
             ret.RedirectRequest = true;
             ret.RedirectWidth = 800;
             ret.RedirectHeight = 500;
             var settings = GetOFXSettings();
             if (settings == null)
             {
                  ret.RedirectURL = "~/Accounting_OFXSettings/Details.aspx?AccountId=" + Id.ToString();
             }
             else
             {
                  ret.RedirectURL = "~/Accounting_OFXSettings/Details.aspx?Id=" + settings.Id.ToString();
             }
             return ret;
        }
 }
Ejemplo n.º 19
0
        public DynamicDataWebMethodReturnType ViewLedger()
        {
            string url = "~/Accounting_LedgerItems/List.aspx?AccountId={0}&LedgerType={1}";
               if (AccountFrom == OrganizationId)
               {
                    //string apbalance = Accounting.Balance_ForLedger(LedgerType.Payable, LoggedInUser.OrganizationId, item.AccountTo, null, null).ToString("C");
                    url = String.Format(url, AccountTo, LedgerType.Payable.ToString());
               }
               else
               {
                    //string arbalance =
                    //Master.AddAttachmentLink("Receivables - " + arbalance, ");

                    url = String.Format(url, AccountFrom, LedgerType.Receivable.ToString());
               }

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.RedirectRequest = true;
               ret.RedirectURL = url;
               return ret;
        }
Ejemplo n.º 20
0
        public DynamicDataWebMethodReturnType ReceivableBalance()
        {
            // do the power up

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.Status = "Not implemented";
               ret.Message = "not implemented";
               ret.Exception = false;
               return ret;

               //string arbalance = Accounting.Balance_ForLedger(LedgerType.Receivable, SelectedOrganization.Id, item.Id, null, null).ToString("C");
               //Master.AddAttachmentLink("Receivable Ledger " + arbalance, "~/company/accounting/ledger?ledgertype=Receivable&id=" + item.Id.ToString(), "");
        }
Ejemplo n.º 21
0
 public DynamicDataWebMethodReturnType ImportData()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectWidth = 800;
        ret.RedirectHeight = 500;
        ret.RedirectURL = "~/Imports/Accounting_LedgerItems.aspx?AccountId=" + Id.ToString();
        return ret;
 }
Ejemplo n.º 22
0
        public DynamicDataWebMethodReturnType ViewLedgerPeriod()
        {
            string ledgerlink = "~/Accounting_LedgerItems/List.aspx?AccountId={0}&LedgerType={1}&PostAt_Start={2}&PostAt_End={3}";

               using (WeavverEntityContainer data = new WeavverEntityContainer())
               {
                    var account = (from x in data.Accounting_Accounts
                                   where x.Id == Account
                                   select x).First();
                    ledgerlink = String.Format(ledgerlink, Account.ToString(),
                                                           account.LedgerType.ToString(),
                                                           StartAt.ToLocalTime().ToString("MM/dd/yy"),
                                                           EndAt.ToLocalTime().ToString("MM/dd/yy"));
               }

               DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
               ret.RedirectURL = ledgerlink;
               ret.RedirectRequest = true;
               return ret;
        }
Ejemplo n.º 23
0
 public DynamicDataWebMethodReturnType ViewLedger()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectWidth = 1192;
        ret.RedirectHeight = 492;
        ret.RedirectURL = "~/Accounting_LedgerItems/List.aspx?AccountId=" + Id.ToString() + "&LedgerType=" + LedgerType.ToString();
        return ret;
 }
Ejemplo n.º 24
0
 public DynamicDataWebMethodReturnType ViewTransaction()
 {
     DynamicDataWebMethodReturnType ret = new DynamicDataWebMethodReturnType();
        ret.RedirectRequest = true;
        ret.RedirectURL = "~/Accounting_LedgerItems/List.aspx?TransactionId=" + Id.ToString();
        return ret;
 }