Exemple #1
0
 private void updateThisFeatureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (grdResults.SelectedRows.Count == 1)
     {
         FdoFeature feat = (FdoFeature)((grdResults.SelectedRows[0].DataBoundItem as DataRowView).Row);
         _presenter.DoUpdate(feat);
     }
     else if (grdResults.SelectedRows.Count > 1)
     {
         List <FdoFeature> features = new List <FdoFeature>();
         foreach (DataGridViewRow row in grdResults.SelectedRows)
         {
             features.Add((FdoFeature)(row.DataBoundItem as DataRowView).Row);
         }
         string           filter = _presenter.GenerateFilter(features.ToArray());
         FdoBulkUpdateCtl ctl    = new FdoBulkUpdateCtl(_presenter.Connection, _presenter.SelectedClassName, filter);
         Workbench.Instance.ShowContent(ctl, ViewRegion.Dialog);
     }
 }
        public override void Run()
        {
            Workbench wb = Workbench.Instance;
            TreeNode node = wb.ObjectExplorer.GetSelectedNode();
            if (node.Level == 3)
            {
                if (MessageService.AskQuestion("This is a dangerous operation. One false filter could cause irreversible data changes. Do you want to continue?"))
                {
                    string name = node.Name;
                    FdoConnectionManager mgr = ServiceManager.Instance.GetService<FdoConnectionManager>();
                    FdoConnection conn = mgr.GetConnection(node.Parent.Parent.Name);

                    FdoBulkUpdateCtl ctl = new FdoBulkUpdateCtl(conn, node.Name);
                    wb.ShowContent(ctl, ViewRegion.Dialog);
                }
            }
        }
 private void updateThisFeatureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (grdResults.SelectedRows.Count == 1)
     {
         FdoFeature feat = (FdoFeature)((grdResults.SelectedRows[0].DataBoundItem as DataRowView).Row);
         _presenter.DoUpdate(feat);
     }
     else if (grdResults.SelectedRows.Count > 1)
     {
         List<FdoFeature> features = new List<FdoFeature>();
         foreach (DataGridViewRow row in grdResults.SelectedRows)
         {
             features.Add((FdoFeature)(row.DataBoundItem as DataRowView).Row);
         }
         string filter = _presenter.GenerateFilter(features.ToArray());
         FdoBulkUpdateCtl ctl = new FdoBulkUpdateCtl(_presenter.Connection, _presenter.SelectedClassName, filter);
         Workbench.Instance.ShowContent(ctl, ViewRegion.Dialog);
     }
 }