Example #1
0
        private void treeAdminUnits_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
        {
            e.Handled = true;
            int userId = ApplicationData.Instance.GetUserId();

            DeleteConfirm confirm = new DeleteConfirm();
            if (confirm.ShowDialog() == DialogResult.OK)
            {
                AdminLevel al = (AdminLevel)e.Model;
                AdminLevelType alt = settings.GetAdminLevelTypeByLevel(al.LevelNumber);
                foreach (var d in demo.GetAdminLevelDemography(al.Id))
                {
                    demo.Delete(d, userId);
                    if (alt.IsAggregatingLevel)
                        demo.AggregateUp(alt, d.DateReported, userId, null, null);
                }
                demo.Delete(al, userId);
                LoadAdminUnits();
            }
        }
Example #2
0
 private void lvDistros_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
 {
     e.Handled = true;
     if (e.Column.AspectName == "EditText")
     {
         PartnerAdd form = new PartnerAdd(partners, (Partner)e.Model);
         form.OnSave += form_OnSave;
         form.ShowDialog();
     }
     else if (e.Column.AspectName == "DeleteText")
     {
         DeleteConfirm confirm = new DeleteConfirm();
         if (confirm.ShowDialog() == DialogResult.OK)
         {
             repo.Delete((Partner)e.Model, ApplicationData.Instance.GetUserId());
             lvDistros.SetObjects(repo.GetPartners());
             OnSave();
         }
     }
 }
        private void lvUsers_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
        {

            e.Handled = true;
            if (e.Column.AspectName == "View")
            {
                UserAdd form = new UserAdd((Member)e.Model);
                form.OnSave += form_OnSave;
                form.ShowDialog();
            }
            else if (e.Column.AspectName == "Delete")
            {
                DeleteConfirm confirm = new DeleteConfirm();
                if (confirm.ShowDialog() == DialogResult.OK)
                {
                    members.Delete((Member)e.Model);
                }
            }
        }
 private void c1Button2_Click(object sender, EventArgs e)
 {
     DeleteConfirm confirm = new DeleteConfirm(Translations.Restore, Translations.RestoreConfirm);
     if (confirm.ShowDialog() == DialogResult.OK)
     {
         string localAppData =
             Environment.GetFolderPath(
             Environment.SpecialFolder.LocalApplicationData);
         string uPath = Path.Combine(localAppData, "IotaInk");
         string backupFile = Path.Combine(uPath, "DatabaseBackup.accdb");
         File.Copy(backupFile, DatabaseData.Instance.FilePath, true);
         OnClose();
     }
 }