using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TelerikTest.Models;

namespace TelerikTest.Services
{
    public class RequestListService : IRequestListService
    {
        public ListRequestVM GetAllForms()
        {
            ListRequestVM listRequestVM = new ListRequestVM();
            RequestorListVM requestorListVM = new RequestorListVM();

            //initialize lists
            List<RequestorListVM> requestorListVMList = new List<RequestorListVM>();

            for (int i = 1; i < 11; i++)
            {
                requestorListVM.FormId = i;
                requestorListVM.RequestorFirstName = "Peter";
                requestorListVM.RequestorLastName = "Pan";
                requestorListVM.RequestorNetworkId = "peterp@test.org";

                Guid formGuid = System.Guid.NewGuid();

                requestorListVM.FormGuid = formGuid;

                requestorListVM.UserFirstName = "Lyndon";
                requestorListVM.UserLastName = "Johnson";
                requestorListVM.UserNetworkId = "johnsonL";

                requestorListVM.AuthorizerEmail = "authorizer@test.org";
                requestorListVM.ApprovedDate = DateTime.Now;
                requestorListVM.CreateDate = DateTime.Now;

                requestorListVMList.Add(new RequestorListVM(requestorListVM.FormId, requestorListVM.FormGuid, requestorListVM.RequestorFirstName,
                    requestorListVM.RequestorLastName, requestorListVM.RequestorNetworkId, requestorListVM.UserFirstName,
                    requestorListVM.UserLastName, requestorListVM.UserNetworkId, requestorListVM.AuthorizerNetworkId,
                    requestorListVM.AuthorizerEmail, requestorListVM.CreateDate, requestorListVM.ApprovedDate));
            }

            listRequestVM.ListRequestor = requestorListVMList;
            return listRequestVM;

        }
    }
}