Exemplo n.º 1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            GenericHelper          genericHelper  = new GenericHelper();
            ActivitySelectorHelper activityHelper = new ActivitySelectorHelper();

            if (activityHelper.TableExists("Region"))
            {
                regionTable = genericHelper.GetList("Region");
            }
            if (activityHelper.TableExists("Zonne"))
            {
                zoneTable = genericHelper.GetList("Zonne");
            }
            if (activityHelper.TableExists("Woreda"))
            {
                woredaTable = genericHelper.GetList("Woreda");
            }
            if (activityHelper.TableExists("Kebele"))
            {
                kebeleTable = genericHelper.GetList("Kebele");
            }
            if (activityHelper.TableExists("Kebele"))
            {
                kebeleTable2 = genericHelper.GetList("Kebele");
            }
        }
Exemplo n.º 2
0
        private void GetData(string tableName)
        {
            dataGridView1.Rows.Clear();
            dataGridView1.Refresh();

            if (activitySelectorHelper.TableExists(tableName))
            {
                //MessageBox.Show("Table exists");
                activityListItem = activitySelectorHelper.GetActivityList(tableName);
                //dataGridView1.DataSource = activityList;
                for (int i = 0; i < activityListItem.Count; i++)
                {
                    string[] row = { activityListItem[i].LocalTimeStamp.ToString(), activityListItem[i].Title };
                    dataGridView1.Rows.Add(row);
                }
            }
        }
Exemplo n.º 3
0
        private void PopulateComboBox(int index)
        {
            ActivitySelectorHelper activitySelectorHelper = new ActivitySelectorHelper();

            tableExists = activitySelectorHelper.TableExists(tableNames[index]);
            if (tableExists)
            {
                //EnableFields(true);
                //MessageBox.Show(Properties.Settings.Default.USERORGANIZATION + " : " + Properties.Settings.Default.USERPARTNER);
                List <string>  activityAsString = new List <string>();
                ActivityHelper activityHelper   = new ActivityHelper();
                activity0List = activityHelper.GetActivityListByPartner(tableNames[index], Properties.Settings.Default.USERORGANIZATION, Properties.Settings.Default.USERPARTNER);
                if (activity0List != null)
                {
                    if (activity0List.Count > 0)
                    {
                        EnableFields(true);
                        for (int i = 0; i < activity0List.Count; i++)
                        {
                            Activity0 activity       = activity0List[i];
                            string    activityString = "[Activity " + index + " ~ ID: " + activity.RemoteId + "] ~ On " + activity.ActivityDate + ": " + activity.Region + ", " + activity.Zone + ", " + activity.Woreda + ", " + activity.Kebele;
                            activityAsString.Add(activityString);
                            activityIds.Add(activity.RemoteId);
                        }
                        comboBox2.DataSource = activityAsString;
                    }
                    else
                    {
                        EnableFields(false);
                    }
                }
            }
            else
            {
                MessageBox.Show("Table does not exist!");
                EnableFields(false);
            }
        }