private void RefreshBtn_Click(object sender, EventArgs e) { APIAccess.Result result = APIAccess.GetDataFromXLAPI <List <MLFSReportingPeriod> >("/MLFSReportingPeriod/GetCurrent"); Periods = (List <MLFSReportingPeriod>)result.Data; BindPeriods(); AddingNew = false; }
private async void MLFSDirRepBtn_Click(object sender, RibbonControlEventArgs e) { APIAccess.Result result = APIAccess.GetDataFromXLAPI <List <MLFSReportingPeriod> >("/MLFSReportingPeriod/GetCurrentPeriods"); MLFSDirRepForm form = new MLFSDirRepForm((List <MLFSReportingPeriod>)result.Data); form.ShowDialog(); if (form.AddingNew) { MessageBox.Show("Reopen form once added"); return; } if (!String.IsNullOrEmpty(form.PlansFile) && !String.IsNullOrEmpty(form.FeesFile) && !String.IsNullOrEmpty(form.FCIFile) && int.TryParse(form.PeriodId, out int i)) { string response = await XLSheet.BuildMLFSDirectorsReport(i, form.FeesFile, form.PlansFile, form.FCIFile); if (response == "Success") { MessageBox.Show("Data Uploaded"); } else { MessageBox.Show("Upload Unsuccessful, check your data"); } } else { MessageBox.Show("Upload Unsuccessful, check your data"); } }
protected void Page_Load(object sender, EventArgs e) { //Instantiate an OAuth2 object OAuth2 oAuth2 = new OAuth2(); //Configure the parameters and callback URL oAuth2.client_id = "f01805e4766ebdc5"; oAuth2.client_secret = "be744c6869ffac80f421742f9aff0732"; oAuth2.redirect_uri = "http://localhost:3000/callback.aspx"; //request if OAuth2 server has granted a code string code = Request.QueryString["code"]; //Instantiate a status object APIAccess.Result status = new APIAccess.Result(); status.result = -1; status.value = ""; //Instantiate a APIAccess object APIAccess fidorapi = new APIAccess(); //Status returned from GetAccessToken API status = fidorapi.GetAccessToken(oAuth2, code); if (status.result == 0) { //save the access token Session["AccessToken"] = status.value; //go to a main page Response.Redirect("Index.aspx"); } }
private void ReportsBtn_Click(object sender, RibbonControlEventArgs e) { APIAccess.Result result = APIAccess.GetDataFromXLAPI <List <MLFSReportingPeriod> >("/MLFSReportingPeriod/GetCurrentPeriods"); if (result.WasSuccessful) { MLFSReportingPeriodForm form = new MLFSReportingPeriodForm((List <MLFSReportingPeriod>)result.Data); form.ShowDialog(); if (form.PeriodId != null) { XLSheet.RunReports((int)form.PeriodId); } } else { MessageBox.Show("Unable to reach server"); } }
protected void Page_Load(object sender, EventArgs e) { string responseCode = Request.QueryString["code"]; OAuth2 oauthContainer = PhishyHelper.getFidorOauth2Container(this.Context.IsDebuggingEnabled); APIAccess fidorApi = new APIAccess(); APIAccess.Result status = new APIAccess.Result(); status.result = -1; status.value = ""; status = fidorApi.GetAccessToken(oauthContainer, responseCode); if (status.result == 0) { Session["Access Token"] = status.value; Response.Redirect("dashboard/"); } }
public static void RunReports(int periodId) { //first get the income data APIAccess.Result result = APIAccess.GetDataFromXLAPI <System.Data.DataTable>("/MLFSReports/SalesReport?periodId=" + periodId); if (result.WasSuccessful) { System.Data.DataTable table = (System.Data.DataTable)result.Data; CreateWorkSheet(table, "Sales Report", firstNumberColumn: "new Amount", addTotalRow: false); //CreatePivot("IncomeRawData", new int[]{ 2, 3, 4 }, new int[] { 1 }, new int[] { 6, 7 }, "AutoPivot", new string[] { "campaign", "organisation" }); } //then the directors' report data result = APIAccess.GetDataFromXLAPI <System.Data.DataTable>("/MLFSReports/DirectorsReport?periodId=" + periodId); if (result.WasSuccessful) { System.Data.DataTable table = (System.Data.DataTable)result.Data; CreateWorkSheet(table, "Directors Report", firstNumberColumn: "Budget", addTotalRow: false); } }