Exemple #1
0
        private void CleanAccessDB()
        {
            CleanLocalDB(local_dataLOV.getCountries, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getDistanceBands, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getLanguages, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getNationalAgencies, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getOrganizationTypes, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getRoles, (toDel => { local_dataLOV.Delete(toDel, false); }));
            CleanLocalDB(local_dataLOV.getTopics, (toDel => { local_dataLOV.Delete(toDel, false); }));
            local_dataLOV.LoadData();

            CleanLocalDB(local_dataPerson.getPersons, (toDel => { local_dataPerson.Delete(toDel, false); }));
            local_dataPerson.LoadData();

            CleanLocalDB(local_dataOrganization.getOrganizations, (toDel => { local_dataOrganization.Delete(toDel, false); }));
            local_dataOrganization.LoadData();

            CleanLocalDB(local_dataProject.getProjectActivities, (toDel => { local_dataProject.Delete(toDel, false); }));
            CleanLocalDB(local_dataProject.getProjectActivityVariations, (toDel => { local_dataProject.Delete(toDel, false); }));
            CleanLocalDB(local_dataProject.getProjects, (toDel => { local_dataProject.Delete(toDel, false); }));
            CleanLocalDB(local_dataProject.getProjectTopics, (toDel => { local_dataProject.Delete(toDel, false); }));
            CleanLocalDB(local_dataProject.getProjectVariationOrganizations, (toDel => { local_dataProject.Delete(toDel, false); }));
            CleanLocalDB(local_dataProject.getProjectVariations, (toDel => { local_dataProject.Delete(toDel, false); }));
            local_dataProject.LoadData();

            CleanLocalDB(local_dataActivity.getActivityTypes, (toDel => { local_dataActivity.Delete(toDel, false); }));
            CleanLocalDB(local_dataActivity.getMobilities, (toDel => { local_dataActivity.Delete(toDel, false); }));
            local_dataActivity.LoadData();
        }
Exemple #2
0
        private void LoadAll()
        {
            local_dataLOV = new domainListOfValues();
            local_dataLOV.LoadData(true);
            sql_dataLOV = new domainListOfValues();
            sql_dataLOV.LoadData(false);
            ProgressBarAdd();

            local_dataPerson = new domainPerson();
            local_dataPerson.LoadData(true);
            sql_dataPerson = new domainPerson();
            sql_dataPerson.LoadData(false);
            ProgressBarAdd();

            local_dataOrganization = new domainOrganization();
            local_dataOrganization.LoadData(true);
            sql_dataOrganization = new domainOrganization();
            sql_dataOrganization.LoadData(false);
            ProgressBarAdd();

            local_dataProject = new domainProject();
            local_dataProject.LoadData(true);
            sql_dataProject = new domainProject();
            sql_dataProject.LoadData(false);
            ProgressBarAdd();

            local_dataActivity = new domainActivity();
            local_dataActivity.LoadData(true);
            sql_dataActivity = new domainActivity();
            sql_dataActivity.LoadData(false);
            ProgressBarAdd();
        }
Exemple #3
0
        public void InitData()
        {
            dataLOV = new domainListOfValues();
            dataLOV.LoadData();

            dataPerson = new domainPerson();
            dataPerson.LoadData();

            dataOrganization = new domainOrganization();
            dataOrganization.LoadData();

            dataProject = new domainProject();
            dataProject.LoadData();

            dataActivity = new domainActivity();
            dataActivity.LoadData();

            string computerName = SystemInformation.ComputerName;
            var    client       = dataLOV.getClients.FirstOrDefault(c => c.ComputerName.ToUpper() == computerName.ToUpper());

            if (client != null)
            {
                CFGStationID = client.ComputerID;
            }
            else
            {
                CFGStationID = dataLOV.getClients.Max(c => c.ComputerID) + 1;
                var clnt = new modelClient(computerName, CFGStationID);
                dataLOV.Insert(clnt);
            }

            projectCalls = new List <modelProjectCall>();
            projectCalls.Add(new modelProjectCall("2017-1", new DateTime(2017, 5, 1)));
            projectCalls.Add(new modelProjectCall("2017-2", new DateTime(2017, 8, 1)));
            projectCalls.Add(new modelProjectCall("2017-3", new DateTime(2018, 1, 1)));
            projectCalls.Add(new modelProjectCall("2018-1", new DateTime(2018, 5, 1)));
            projectCalls.Add(new modelProjectCall("2018-2", new DateTime(2018, 8, 1)));
            projectCalls.Add(new modelProjectCall("2018-3", new DateTime(2019, 1, 1)));
            projectCalls.Add(new modelProjectCall("2019-1", new DateTime(2019, 5, 1)));
            projectCalls.Add(new modelProjectCall("2019-2", new DateTime(2019, 8, 1)));
        }
Exemple #4
0
        private void ibuttonWriteChanges_Click(object sender, EventArgs e)
        {
            foreach (var change in allChanges.Where(c => c.newSQL == false && c.newAccess == false))
            {
                if (change.Abbrev == "modelCountry")
                {
                    if (change.syncAccessToSQL)
                    {
                        var country = local_dataLOV.getCountry(change.ID);
                        sql_dataLOV.Write(country, false);
                    }
                    else
                    {
                        var country = sql_dataLOV.getCountry(change.ID);
                        local_dataLOV.Write(country, false);
                    }
                }
                if (change.Abbrev == "modelLanguage")
                {
                    if (change.syncAccessToSQL)
                    {
                        var lang = local_dataLOV.getLanguage(change.ID);
                        sql_dataLOV.Write(lang, false);
                    }
                    else
                    {
                        var lang = sql_dataLOV.getLanguage(change.ID);
                        local_dataLOV.Write(lang, false);
                    }
                }
                if (change.Abbrev == "modelNationalAgency")
                {
                    if (change.syncAccessToSQL)
                    {
                        var natagency = local_dataLOV.getNationalAgency(change.ID);
                        sql_dataLOV.Write(natagency, false);
                    }
                    else
                    {
                        var natagency = sql_dataLOV.getNationalAgency(change.ID);
                        local_dataLOV.Write(natagency, false);
                    }
                }
                if (change.Abbrev == "modelDistanceBand")
                {
                    if (change.syncAccessToSQL)
                    {
                        var distband = local_dataLOV.getDistanceBand(change.ID);
                        sql_dataLOV.Write(distband, false);
                    }
                    else
                    {
                        var distband = sql_dataLOV.getDistanceBand(change.ID);
                        local_dataLOV.Write(distband, false);
                    }
                }
                if (change.Abbrev == "modelPerson")
                {
                    if (change.syncAccessToSQL)
                    {
                        var pers = local_dataPerson.getPerson(change.ID);
                        sql_dataPerson.Write(pers, false);
                    }
                    else
                    {
                        var pers = sql_dataPerson.getPerson(change.ID);
                        local_dataPerson.Write(pers, false);
                    }
                }
                if (change.Abbrev == "modelRole")
                {
                    if (change.syncAccessToSQL)
                    {
                        var role = local_dataLOV.getRole(change.ID);
                        sql_dataLOV.Write(role, false);
                    }
                    else
                    {
                        var role = sql_dataLOV.getRole(change.ID);
                        local_dataLOV.Write(role, false);
                    }
                }
                if (change.Abbrev == "modelTopic")
                {
                    if (change.syncAccessToSQL)
                    {
                        var topic = local_dataLOV.getTopic(change.ID);
                        sql_dataLOV.Write(topic, false);
                    }
                    else
                    {
                        var topic = sql_dataLOV.getTopic(change.ID);
                        local_dataLOV.Write(topic, false);
                    }
                }
                if (change.Abbrev == "modelClient")
                {
                    if (change.syncAccessToSQL)
                    {
                        var client = local_dataLOV.getClient(change.ID);
                        sql_dataLOV.Write(client, false);
                    }
                    else
                    {
                        var client = sql_dataLOV.getClient(change.ID);
                        local_dataLOV.Write(client, false);
                    }
                }
                if (change.Abbrev == "modelOrganization")
                {
                    if (change.syncAccessToSQL)
                    {
                        var pers = local_dataOrganization.getOrganization(change.ID);
                        sql_dataOrganization.Write(pers, false);
                    }
                    else
                    {
                        var pers = sql_dataOrganization.getOrganization(change.ID);
                        local_dataOrganization.Write(pers, false);
                    }
                }
                if (change.Abbrev == "modelOrganizationType")
                {
                    if (change.syncAccessToSQL)
                    {
                        var orgtype = local_dataLOV.getOrganizationType(change.ID);
                        sql_dataLOV.Write(orgtype, false);
                    }
                    else
                    {
                        var orgtype = sql_dataLOV.getOrganizationType(change.ID);
                        local_dataLOV.Write(orgtype, false);
                    }
                }
                if (change.Abbrev == "modelActivityType")
                {
                    if (change.syncAccessToSQL)
                    {
                        var acttype = local_dataActivity.getActivityType(change.ID);
                        sql_dataActivity.Write(acttype, false);
                    }
                    else
                    {
                        var acttype = sql_dataActivity.getActivityType(change.ID);
                        local_dataActivity.Write(acttype, false);
                    }
                }
                if (change.Abbrev == "modelProject")
                {
                    if (change.syncAccessToSQL)
                    {
                        var prj = local_dataProject.getProject(change.ID);
                        sql_dataProject.Write(prj, false);
                    }
                    else
                    {
                        var prj = sql_dataProject.getProject(change.ID);
                        local_dataProject.Write(prj, false);
                    }
                }

                if (change.Abbrev == "Project Activity")
                {
                    if (change.syncAccessToSQL)
                    {
                        var prjact = local_dataProject.getProjectActivity(change.ID);
                        sql_dataProject.Write(prjact, false);
                    }
                    else
                    {
                        var prjact = sql_dataProject.getProjectActivity(change.ID);
                        local_dataProject.Write(prjact, false);
                    }
                }
                if (change.Abbrev == "Project Variation")
                {
                    if (change.syncAccessToSQL)
                    {
                        var prjvar = local_dataProject.getProjectVariation(change.ID);
                        sql_dataProject.Write(prjvar, false);
                    }
                    else
                    {
                        var prjvar = sql_dataProject.getProjectVariation(change.ID);
                        local_dataProject.Write(prjvar, false);
                    }
                }
                if (change.Abbrev == "Project Activity Variation")
                {
                    if (change.syncAccessToSQL)
                    {
                        var prjactvar = local_dataProject.getProjectActivityVariation(change.ID);
                        sql_dataProject.Write(prjactvar, false);
                    }
                    else
                    {
                        var prjactvar = sql_dataProject.getProjectActivityVariation(change.ID);
                        local_dataProject.Write(prjactvar, false);
                    }
                }
                if (change.Abbrev == "Project Activity Variation Organization")
                {
                    if (change.syncAccessToSQL)
                    {
                        var prjactvarorg = local_dataProject.getProjectVariationOrganization(change.ID);
                        sql_dataProject.Write(prjactvarorg, false);
                    }
                    else
                    {
                        var prjactvarorg = sql_dataProject.getProjectVariationOrganization(change.ID);
                        local_dataProject.Write(prjactvarorg, false);
                    }
                }
                if (change.Abbrev == "Project Activity Variation Mobility")
                {
                    if (change.syncAccessToSQL)
                    {
                        var mob = local_dataActivity.getMobility(change.ID);
                        sql_dataActivity.Write(mob, false);
                    }
                    else
                    {
                        var mob = sql_dataActivity.getMobility(change.ID);
                        local_dataActivity.Write(mob, false);
                    }
                }
            }

            local_dataLOV.LoadData();
            sql_dataLOV.LoadData();
        }