Ejemplo n.º 1
0
        public void updateRoadInformation()
        {
            var          googleSheet          = new GoogleSheetApi();
            const string boothInformationpage = "BoothToRoad";
            var          values = googleSheet.getSheetData(boothInformationpage, "A2:B");
            var          roadInformation_tmp = new List <RoadInformation>();

            foreach (var row in values)
            {
                // Print columns A and E, which correspond to indices 0 and 4.
                Console.WriteLine("{0}, {1}", row[0], row[1]);
                roadInformation_tmp.Add(new RoadInformation()
                {
                    boothNumber = Int32.Parse(row[0].ToString()),
                    address     = row[1].ToString()
                });
            }

            roadInformation = roadInformation_tmp;
        }
Ejemplo n.º 2
0
        public void updateAgentInformation()
        {
            var          googleSheet          = new GoogleSheetApi();
            const string agentInformationpage = "AgentInformation";
            var          values = googleSheet.getSheetData(agentInformationpage, "A3:D");
            var          agentInformation_tmp = new List <AgentInformation>();

            foreach (var row in values)
            {
                // Print columns A and E, which correspond to indices 0 and 4.
                Console.WriteLine("{0}, {1}, {2}, {3}", row[0], row[1], row[2], row[3]);
                agentInformation_tmp.Add(new AgentInformation()
                {
                    boothNumber = Int32.Parse(row[0].ToString()),
                    agentName   = row[1].ToString(),
                    phoneNumber = row[2].ToString(),
                    address     = row[3].ToString()
                });
            }

            agentInformation = agentInformation_tmp;
        }
Ejemplo n.º 3
0
        public void updateContactsInformation()
        {
            var          googleSheet            = new GoogleSheetApi();
            const string contactInformationpage = "Contacts";
            var          values = googleSheet.getSheetData(contactInformationpage, "A3:E");
            var          contactInformation_tmp = new List <ContactsInformation>();

            foreach (var row in values)
            {
                // Print columns A and E, which correspond to indices 0 and 4.
                Console.WriteLine("{0}, {1}, {2}, {3}", row[0], row[1], row[2], row[3]);
                contactInformation_tmp.Add(new ContactsInformation()
                {
                    wardNumber  = Int32.Parse(row[0].ToString()),
                    position    = row[1].ToString(),
                    name        = row[2].ToString(),
                    phoneNumber = row[3].ToString(),
                    Notes       = row.Count == 5 ? row[4].ToString() : ""
                });
            }

            contactInformation = contactInformation_tmp;
        }
Ejemplo n.º 4
0
        public void updateBoothInformation()
        {
            var          googleSheet          = new GoogleSheetApi();
            const string boothInformationpage = "ElectionBooths";
            var          values = googleSheet.getSheetData(boothInformationpage, "A3:E");
            var          boothInformation_tmp = new List <BoothInformation>();

            foreach (var row in values)
            {
                // Print columns A and E, which correspond to indices 0 and 4.
                Console.WriteLine("{0}, {1}, {2}, {3}", row[0], row[1], row[2], row[3]);
                boothInformation_tmp.Add(new BoothInformation()
                {
                    boothNumber = Int32.Parse(row[0].ToString()),
                    wardNumber  = Int32.Parse(row[1].ToString()),
                    population  = Int32.Parse(row[2].ToString()),
                    address     = row[3].ToString(),
                    locality    = row[4].ToString()
                });
            }

            boothInformation = boothInformation_tmp;
        }