Beispiel #1
0
    // GET: Test
    public async Task <ActionResult> Index()
    {
        DateTime BeginDate             = new DateTime(2015, 1, 1);
        DateTime EndDate               = new DateTime(2015, 12, 31);
        string   AuthenticatedUser     = "******";
        bool     RecognizedOrSubmitted = true;
        string   baseUrl               = GetBaseUrl();
        var      client = new HttpClient();

        client.BaseAddress = baseUrl;
        string VPath = "api/WebAPI/GetAllRecognitionsBySupervisorAll";

        ViewModels.AllRecognitionsbyAllSupervisors AllRByAllS = new ViewModels.AllRecognitionsbyAllSupervisors(BeginDate, EndDate, AuthenticatedUser, RecognizedOrSubmitted);
        var response = await client.PostAsync(VPath, AllRByAllS);

        return(View());
    }
    // GET: Test
    public async Task <ActionResult> Index()
    {
        DateTime BeginDate             = new DateTime(2015, 1, 1);
        DateTime EndDate               = new DateTime(2015, 12, 31);
        string   AuthenticatedUser     = "******";
        bool     RecognizedOrSubmitted = true;

        string VPath = "api/WebAPI/GetAllRecognitionsBySupervisorAll";

        ViewModels.AllRecognitionsbyAllSupervisors AllRByAllS = new ViewModels.AllRecognitionsbyAllSupervisors(BeginDate, EndDate, AuthenticatedUser, RecognizedOrSubmitted);
        var baseUrl = new Uri("http://localhost:1234/"); //Replace with api host address
        var client  = new HttpClient();                  //Use this to call web api

        client.BaseAddress = baseUrl;
        //post viewmodel to web api using this extension method
        var response = await client.PostAsJsonAsync(VPath, AllRByAllS);

        return(View());
    }
Beispiel #3
0
    public static void GetAllRecognitionsBySupervisorAll([FromBody] ViewModels.AllRecognitionsbyAllSupervisors AllRByAllS)
    {
        DataSet ds = Classes.Recognitions.GetAllRecognitionsBySupervisorAll(AllRByAllS.BeginDate, AllRByAllS.EndDate, AllRByAllS.RecognizedOrSubmitted);

        Classes.DataHelper.SendMeExcelFile(ds, "GetAllRecognitionsBySupervisorAll", AllRByAllS.AuthenticatedUser);
    }