Пример #1
0
        public void SFDCLogin()
        {
            //Login to salesforce

            mySFDCConnection = new salesforce.SforceService();
            salesforce.LoginResult loginSFDC;

            //mySFDCConnection.Url = siteLocation;

            loginSFDC = mySFDCConnection.login("*****@*****.**", "Manhattan123");

            mySFDCConnection.SessionHeaderValue = new salesforce.SessionHeader();
            mySFDCConnection.SessionHeaderValue.sessionId = loginSFDC.sessionId;
            mySFDCConnection.Url = loginSFDC.serverUrl;
        }
Пример #2
0
        private psaUser.psaWebServiceFacadeService CreateSFDCConnection()
        {
            mySFDCConnection = new salesforce.SforceService();

            salesforce.LoginResult loginSFDC;

            //mySFDCConnection.Url = siteLocation;

            loginSFDC = mySFDCConnection.login("*****@*****.**", "Manhattan123");

            mySFDCConnection.SessionHeaderValue = new salesforce.SessionHeader();
            mySFDCConnection.SessionHeaderValue.sessionId = loginSFDC.sessionId;
            mySFDCConnection.Url = loginSFDC.serverUrl;

            psaUser.psaWebServiceFacadeService myUserService = new psaUser.psaWebServiceFacadeService();

            ICredentials credentials = new NetworkCredential("*****@*****.**", "Manhattan123", "US");

            myUserService.Credentials = credentials;
            myUserService.SessionHeaderValue = new psaUser.SessionHeader();

            myUserService.SessionHeaderValue.sessionId = loginSFDC.sessionId;
            return myUserService;
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            txtResults.Text = string.Empty;
            psaExpense1.psaConcurExpenseReport myReport = new psaExpense1.psaConcurExpenseReport();
            psaExpense1.psaConcurExpense myExpense = new psaExpense1.psaConcurExpense();

            myReport.approverId = "44";
            myReport.billable = true;
            myReport.billableSpecified = true;
            myReport.concurExtractDate = DateTime.Today;
            myReport.concurExtractDateSpecified = true;
            myReport.concurReportKey = "010";
            myReport.dateReimbursed = DateTime.Today;
            myReport.dateReimbursedSpecified = true;
            myReport.dateSubmitted = DateTime.Today;
            myReport.dateSubmittedSpecified = true;
            myReport.description = "test Run";
            myReport.projectCode = "PR-001936";
            myReport.reportName = "test me";
            myReport.resourceId = "99990";

            int i = 0;

            myExpense.billable = true;
            myExpense.billableSpecified = true;
            myExpense.concurEntryId = "987";
            myExpense.description = "Cell phone";
            myExpense.expenseAmount = 900;
            myExpense.expenseAmountSpecified = true;
            myExpense.expenseCountry = "US";
            myExpense.expenseCurrencyCode="USD";
            myExpense.expenseDate = DateTime.Today;
            myExpense.expenseDateSpecified = true;
            myExpense.expenseNonBillableAmount = 0;
            myExpense.expenseNonBillableAmountSpecified = true;
            myExpense.expenseState = "UT";
            myExpense.expenseType = "Barf";
            myExpense.expenseVendor = "ATT";
            myExpense.govAllowanceAmount = 9;
            myExpense.govAllowanceAmountSpecified = true;

            myExpense.incurredTaxAmount = 8;
            myExpense.incurredTaxAmountSpecified = true;
            myExpense.incurredTaxNonBillable = false;
            myExpense.incurredTaxNonBillableSpecified = true;
            myExpense.millage = 9;
            myExpense.millageReimbursementRate = 0.1;
            myExpense.millageReimbursementRateSpecified = true;
            myExpense.millageSpecified = true;
            myExpense.nonReimbursible = false;
            myExpense.nonReimbursibleSpecified = true;
            myExpense.notes = "kjsfdhgakj";
            myExpense.numberOfAttendees = 0;
            myExpense.numberOfAttendeesSpecified = false;
            myExpense.taxType = "raet";

            psaExpense1.psaConcurExpenseReport[] myArray;
            psaExpense1.psaConcurExpense[] myExpArr;

            myArray=new psaExpense1.psaConcurExpenseReport[1];
            myExpArr = new psaExpense1.psaConcurExpense[1];
            myExpArr[0] = myExpense;

            myReport.expenses = myExpArr;
            myArray[0]=myReport;

            mySFDCConnection = new salesforce.SforceService();

            salesforce.LoginResult loginSFDC;

            //mySFDCConnection.Url = siteLocation;

            loginSFDC = mySFDCConnection.login("*****@*****.**", "Manhattan123");

            mySFDCConnection.SessionHeaderValue = new salesforce.SessionHeader();
            mySFDCConnection.SessionHeaderValue.sessionId = loginSFDC.sessionId;
            mySFDCConnection.Url = loginSFDC.serverUrl;

            psaExpense1.psaExpenseWSFacadeService myService = new psaExpense1.psaExpenseWSFacadeService();

            ICredentials credentials = new NetworkCredential("*****@*****.**", "Manhattan123", "US");

            myService.Credentials = credentials;
            myService.SessionHeaderValue = new psaExpense1.SessionHeader();

            myService.SessionHeaderValue.sessionId = loginSFDC.sessionId;

            myService.insertExpenses("9", myArray);
        }