コード例 #1
0
 public AttributionRuleVM(BaseSIForm parent)
 {
     _parent = parent;
     RuleList = new BindingListView<AttributionRuleDTO>((IList)null);
     ConditionSetView = new ConditionSetView();
     ConditionSetView.OnDataChanged += ConditionSetView_OnDataChanged;
 }
コード例 #2
0
 public KnowledgeBaseVM(BaseEAForm form)
 {
     _mainForm = form;
     Perspective = emotionalAppraisalAsset.Perspective.ToString();
     Beliefs = new BindingListView<BeliefDTO>(new List<BeliefDTO>());
     UpdateBeliefList();
 }
コード例 #3
0
ファイル: QueryRequestor.cs プロジェクト: lgatto/proteowizard
 public QueryRequestor(BindingListView bindingListView)
 {
     _bindingListView = bindingListView;
     // ReSharper disable once PossiblyMistakenUseOfParamsMethod
     _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(bindingListView.CancellationToken);
     _queryParameters = QueryParameters.Empty;
     _rowSourceWrapper = RowSourceWrapper.Empty;
 }
コード例 #4
0
ファイル: Helpers.cs プロジェクト: Romonaga/DailyMile-Backup
        public static DailyMileEntries MergeEntries(string fileName, DailyMileEntries entries)
        {
            BindingListView<DailyMileEntry> fileentries;
            BindingListView<DailyMileEntry> downloadedEntries;

            DailyMileEntries murgedEntries;

            murgedEntries = new DailyMileEntries();

            try
            {

                //convert downloaded entries to BLV
                downloadedEntries = new BindingListView<DailyMileEntry>(entries.Entries);

                //Read stored collection

                fileentries = new BindingListView<DailyMileEntry>(DailyMileAPI.GetStoredEntries(fileName).Entries);

                foreach (DailyMileEntry entry in downloadedEntries)
                {
                    if (fileentries != null)
                    {
                        if (fileentries.Exists("ID", entry.ID) == true)
                        {
                            fileentries.RemoveItems("ID", entry.ID);
                        }
                    }

                    fileentries.Add(entry);
                }

                using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None))
                {

                    using (BinaryWriter binWriter = new BinaryWriter(fs))
                    {
                        murgedEntries = new DailyMileEntries();
                        fileentries.SortDirection = ListSortDirection.Descending;
                        fileentries.SortFields = "ID";
                        murgedEntries.Entries = fileentries.GetList();

                        binWriter.Write(SerializersJSON.Serialize<DailyMileEntries>(murgedEntries));
                    }
                }

            }
            catch (VSException ve)
            {
                throw ve;
            }
            catch (System.Exception ex)
            {
                throw new VSException(string.Format("MergeEntries FileName({0}) Exception {1}", fileName, ex.Message));
            }

            return murgedEntries;
        }
コード例 #5
0
        public MainForm()
        {
            InitializeComponent();

            _conditionSetView = new ConditionSetView();
            conditionSetEditor.View = _conditionSetView;
            _conditionSetView.OnDataChanged += conditionSetView_OnDataChanged;

            this._reactiveActions = new BindingListView<ReactionDTO>((IList)null);
            dataGridViewReactiveActions.DataSource = this._reactiveActions;
        }
コード例 #6
0
ファイル: SimpleForm.cs プロジェクト: Kolenov/BindingListView
        private void LoadFeed()
        {
            // Get the BBC news RSS feed
            Feed feed = new Feed("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml");
            feed.Update();

            // Create a view of the items
            itemsView = new BindingListView<Item>(feed.Items);
            // Make the grid display this view
            itemsGrid.DataSource = itemsView;
        }
コード例 #7
0
 public BindingListView<PayPaymentOrderPackPayment> FindByPaymentOrderPackId(long paymentOrderPackId)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@paymentOrderPackId", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((long) paymentOrderPackId);
     BindingListView<PayPaymentOrderPackPayment> view = new BindingListView<PayPaymentOrderPackPayment>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(this.SelectQuery + "where paymentOrderPackId=@paymentOrderPackId", parameters).Rows)
     {
         PayPaymentOrderPackPayment owid = new PayPaymentOrderPackPayment();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #8
0
ファイル: Form1.cs プロジェクト: diegoogle/ProjectsCSharp
        private void dgAlumnos_SelectionChanged(object sender, System.EventArgs e)
        {
            bopTodas.Checked = true;
            ObjectView <alumno> al = odAlumnos.Current as ObjectView <alumno>;

            if (al == null)
            {
                return;
            }
            idAlumnoActual           = al.Object.id_alumno;
            vistaAsignaturas         = provDatos.ObtenerAsignaturas(idAlumnoActual);
            odAsignaturas.DataSource = vistaAsignaturas;
        }
コード例 #9
0
        private void LoadCardDeckLeaderAbilitesData()
        {
            byte[][][] byteArray = this.dataAccess.LoadCardDeckLeaderAbilities();
            this.cardDeckLeaderAbilities        = new CardDeckLeaderAbilities(byteArray);
            this.cardDeckLeaderAbilitiesBinding = new BindingListView <CardDeckLeaderAbility>(this.cardDeckLeaderAbilities.List);
            this.cardDeckLeaderAbilitiesDatagridview.DataSource = this.cardDeckLeaderAbilitiesBinding;

            if (!deckLeaderAbilityDataGridViewIsSetup)
            {
                this.setupDeckLeaderAbilitiesDataGridView();
                this.deckLeaderAbilityDataGridViewIsSetup = true;
            }
        }
コード例 #10
0
 private void LogsDB_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         promptToSave = false;
         //update bindinglist
         studyLogListView           = new BindingListView <StudyLog>(LogData.StudyLogs);
         dataGridViewRef.DataSource = studyLogListView;
         LogsDBView.Sort(LogsDBView.Columns["logsEndDate"], ListSortDirection.Descending);
         LogsDBView.Refresh();
         FilterDialogForm.ClearFilter(FilterDialogForm.FilterDialog);
     }
 }
コード例 #11
0
ファイル: Role.cs プロジェクト: u4097/SQLScript
 public static BindingListView<Role> Get()
 {
     BindingListView<Role> view = new BindingListView<Role>();
     foreach (Role role in GetRoles())
     {
         view.Add(role);
     }
     foreach (Role role2 in GetRights())
     {
         view.Add(role2);
     }
     return view;
 }
コード例 #12
0
ファイル: Form1.cs プロジェクト: diegoogle/ProjectsCSharp
        private void lstAlumnos_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ObjectView <alumno> al = odAlumnos.Current as ObjectView <alumno>;

            if (al == null)
            {
                return;
            }
            idAlumnoActual           = al.Object.id_alumno;
            vistaAsignaturas         = provDatos.ObtenerAsignaturas(idAlumnoActual);
            odAsignaturas.DataSource = vistaAsignaturas;
            lstAsignaturas_SelectedIndexChanged(lstAsignaturas, null);
        }
コード例 #13
0
 public MyForm()
 {
     InitializeComponent();
     
     this.MyItems = new BindingListView<MyType>(this.components);
     // components is created in InitializeComponents
     this.MyBindingSource.DataSource = this.MyItems;
     this.MyDataGridView.DataSource = this.MyBindingSource;
     // assigning the DataPropertyNames of the columns can be done in the designer,
     // however doing it the following way helps you to detect errors at compile time
     // instead of at run time
     this.columnPropertyA = nameof(MyType.PropertyA);
     this.columnPropertyB = nameof(MyType.PropertyB);
コード例 #14
0
ファイル: FactorsSettings.cs プロジェクト: nyulacska/tupux
        private void btnReset_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want rest the factors", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                HelperEstimation.ResetProfile();

                _factors = UMLFactorCollection.GetFactors(true);

                BindingListView <UMLFactor> view = new BindingListView <UMLFactor>(_factors);
                this.uMLFactorCollectionBindingSource.DataSource = view;
                view.RemovingItem += new RemoveEventHandler <UMLFactor>(view_RemovingItem);
            }
        }
コード例 #15
0
ファイル: FactorsSettings.cs プロジェクト: emanuelshv/tupux
        private void btnReset_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want rest the factors", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                HelperEstimation.ResetProfile();

                _factors = UMLFactorCollection.GetFactors(true);

                BindingListView<UMLFactor> view = new BindingListView<UMLFactor>(_factors);
                this.uMLFactorCollectionBindingSource.DataSource = view;
                view.RemovingItem += new RemoveEventHandler<UMLFactor>(view_RemovingItem);
            }
        }                
コード例 #16
0
        private void MoveForm_Shown(object sender, EventArgs e)
        {
            // GET DEFAULT DATA
            LicensesDGV = DataAccess_GDataTable.GetAllData(Config.DBDir_Name);
            // PUT DATA INTO SORTABLE LIST
            BindingListView <License> SortableLicensesDGV = new BindingListView <License>(LicensesDGV);

            // SET DGV.DATASOURCE
            aDataGridViewLicenses.DataSource = SortableLicensesDGV;
            // SET DEFAULT SORTATION
            DGVUtilities.SetSortationDefault(5, SortOrder.Descending, aDataGridViewLicenses);
            Utilities.CloseSQLConnection();
        }
コード例 #17
0
        public void CarregarListaLancamentoPedido()
        {
            List <ModelLibrary.ListaPedidoItem> pedidos = ModelLibrary.MetodosDeposito.ObterListaPedidoItem(cRetornoPedidoId);

            BindingListView <ModelLibrary.ListaPedidoItem> view = new BindingListView <ModelLibrary.ListaPedidoItem>(pedidos);

            localDepositoForm.grdLancPedido.DataSource = view;

            localDepositoForm.grdLancPedido.Columns[0].Visible = false;
            localDepositoForm.grdLancPedido.Columns[2].Width   = 450;
            localDepositoForm.grdLancPedido.Columns[5].DefaultCellStyle.Format = "c";
            localDepositoForm.grdLancPedido.Columns[6].Visible = false;
        }
コード例 #18
0
 public BindingListView <alum_asig> ObtenerAlumAsig(int idAlumno, int idAsignatura)
 {
     using (bd_notasAlumnosEntities
            contextoDeObjs = new bd_notasAlumnosEntities())
     {
         var alumAsig =
             from al_as in contextoDeObjs.alums_asigs
             where al_as.id_alumno == idAlumno && al_as.id_asignatura == idAsignatura
             select al_as;
         BindingListView <alum_asig> vista;
         vista = new BindingListView <alum_asig>(alumAsig.ToList());
         return(vista);
     }
 }
コード例 #19
0
        public BindingListView <User> GetUsers(string contains, Role?role, string SortBy = null, bool?activeOnly = true)
        {
            ObservableCollection <User> list = GetUsers(Settings.GetCompanyName(), contains,
                                                        role ?? Role.AllRoles,
                                                        activeOnly);
            var ret = new BindingListView <User>(list.ToList());

            if (!String.IsNullOrWhiteSpace(SortBy))
            {
                ret.Sort = SortBy;
            }

            return(ret);
        }
コード例 #20
0
        /// <summary>
        /// * Get data from database tables
        /// * Setup events to work with data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Shown(object sender, EventArgs e)
        {
            CompanyLikeToolStripTextBox.TextBox.SetCueText("Filter condition");

            gridView.EditingControlShowing += DataGridView1_EditingControlShowing;

            gridView.AutoGenerateColumns = false;

            _customersView = new BindingListView <CustomerEntity>(_operations.AllCustomers(context));

            /*
             * Setup DataGridViewComboBox columns
             */
            CountyNameColumn.DisplayMember    = "CountyName";
            CountyNameColumn.ValueMember      = "CountryIdentifier";
            CountyNameColumn.DataPropertyName = "CountryIdentifier";
            CountyNameColumn.DataSource       = _operations.GetCountries();
            // comment to show the combobox on each row
            CountyNameColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;

            ContactTitleColumn.DisplayMember    = "ContactTitle";
            ContactTitleColumn.ValueMember      = "ContactTypeIdentifier";
            ContactTitleColumn.DataPropertyName = "ContactTypeIdentifier";
            ContactTitleColumn.DataSource       = _operations.GetContactTypes();
            // comment to show the combobox on each row
            ContactTitleColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;

            /*
             * Assign list of customers to the BindingSource which then
             * in turn is used to display customers in the DataGridView
             * with sorting capability via the BindingListView
             */
            _customersBindingSource.DataSource = _customersView;
            gridView.DataSource = _customersBindingSource;

            gridView.ExpandColumns();

            bindingNavigator1.BindingSource = _customersBindingSource;

            var contactTypes = _operations.GetContactTypes();

            contactTypes.Insert(0, new ContactType()
            {
                ContactTypeIdentifier = 0, ContactTitle = "All"
            });
            ContactTypeComboBox.DataSource    = contactTypes;
            ContactTypeComboBox.DisplayMember = "ContactTitle";

            CompanyNameConditiontoolStripComboBox.SelectedIndex = 1;
        }
コード例 #21
0
 private void _view_LoadData(object sender, EventArgs e)
 {
     using (new WaitCursorHandler())
     {
         if (_view.ListDataGrid != null)
         {
             _listObjs    = _services.GetByDate(DateTime.Now.Date).ToList();
             _bindingView = new BindingListView <PengeluaranModel>(_listObjs);
             _view.ListDataGrid.DataSource = _bindingView;
             _bindingView.ListChanged     += _bindingView_ListChanged;
             HitungRingkasan();
         }
     }
 }
コード例 #22
0
ファイル: Form1.cs プロジェクト: Kolenov/BindingListView
        public Form1()
        {
            InitializeComponent();

            // Create view of customers list
            BindingListView<Customer> view = new BindingListView<Customer>(GetCustomers());
            // Data bind to the view
            customerBindingSource.DataSource = view;

            // Change the orders binding source to use the auto provided view
            // instead of the normal list.
            ordersBindingSource.DataMember = "OrdersView";
            detailsBindingSource.DataMember = "DetailsView";
        }
コード例 #23
0
ファイル: frmLoadElement.cs プロジェクト: iamwsx05/hms
        private void clstElement_DrawItem(object sender, DevExpress.XtraEditors.ListBoxDrawItemEventArgs e)
        {
            BindingListView <EntityElementTemplate> source = clstElement.DataSource as BindingListView <EntityElementTemplate>;

            if (source != null)
            {
                EntityElementTemplate objElementTemplate = source.FirstOrDefault(t => t.serno.ToString() == e.Item.ToString());
                if (objElementTemplate.linkSerno != null)
                {
                    e.Appearance.ForeColor = Color.Blue;
                    //e.Appearance.Font = new Font("宋体", 10.5f, FontStyle.Bold);
                }
            }
        }
コード例 #24
0
 private void _view_LoadData(object sender, EventArgs e)
 {
     using (new WaitCursorHandler())
     {
         if (_view.ListDataGrid != null)
         {
             _listObjs    = _services.GetAll().ToList();
             _bindingView = new BindingListView <PenyesuaianStokModel>(_listObjs);
             _view.ListDataGrid.DataSource = _bindingView;
             _bindingView.ListChanged     += _bindingView_ListChanged;
             HitungTotal();
         }
     }
 }
コード例 #25
0
        private void LoadFusionData()
        {
            this.fusionsDataGridView.DataSource = null;
            byte[] fusionBytes = this.dataAccess.LoadFusionData();
            this.fusions = new Fusions(fusionBytes);

            if (!this.fusionDataGridviewIsSetup)
            {
                this.SetupFusionDataGridView();
            }

            this.fusionsBinding = new BindingListView <Fusion>(this.fusions.fusions);
            this.fusionsDataGridView.DataSource = this.fusionsBinding;
        }
コード例 #26
0
 public BindingListView <asignatura> ObtenerAsignaturas(int idAlumno)
 {
     using (bd_notasAlumnosEntities
            contextoDeObjs = new bd_notasAlumnosEntities())
     {
         var asigs =
             from al_as in contextoDeObjs.alums_asigs
             where al_as.id_alumno == idAlumno
             select al_as.asignatura;
         BindingListView <asignatura> vista;
         vista = new BindingListView <asignatura>(asigs.ToList());
         return(vista);
     }
 }
コード例 #27
0
 private void GenerateQnAData()
 {
     try
     {
         dgv_Answ_Stat.AutoGenerateColumns = false;
         BindingListView <sp_GetAnswerIntentStatistics_Result> view = new BindingListView <sp_GetAnswerIntentStatistics_Result> (db.sp_GetAnswerIntentStatistics(null).ToList());
         dgv_Answ_Stat.DataSource = view;
     }
     catch (Exception e)
     {
         MessageBox.Show("Greska u konekciji, pokusajte opet.");
         Console.WriteLine(e);
     }
 }
コード例 #28
0
ファイル: DataMessage.cs プロジェクト: Proerp/STS07JUL
        private void InitializeDataGridBinding()
        {
            this.dataGridViewDataMessageMaster.ColumnHeadersDefaultCellStyle.Font    = new Font(this.dataGridViewDataMessageMaster.DefaultCellStyle.Font.Name, 9, FontStyle.Regular);
            this.dataGridViewDataMessageMaster.ColumnHeadersDefaultCellStyle.Padding = new Padding(0, 3, 0, 3);
            this.dataGridViewDataMessageMaster.AutoGenerateColumns = false;
            dataMessageMasterListView = new BindingListView <DataMessageMaster>(this.dataMessageBLL.DataMessageMasterList);
            this.dataGridViewDataMessageMaster.DataSource = dataMessageMasterListView;



            #region <dataGridViewDetail>

            #endregion <dataGridViewDetail>
        }
コード例 #29
0
        void CarregarGradeCargaProduto(int pCargaId)
        {
            try
            {
                ModelLibrary.Representante representante = (ModelLibrary.Representante)localDepositoForm.cbbCargaRepresentante.SelectedItem;
                var representanteId      = representante.Id;
                ModelLibrary.Praca praca = (ModelLibrary.Praca)localDepositoForm.cbbCargaPraca.SelectedItem;
                var pracaId = praca.Id;
                int mes     = localDepositoForm.cbbCargaMesAno.Value.Month;
                int ano     = localDepositoForm.cbbCargaMesAno.Value.Year;



                List <ModelLibrary.ListaProdutosCarga> produtos = ModelLibrary.MetodosDeposito.ObterProdutosCarga(pCargaId);

                BindingListView <ModelLibrary.ListaProdutosCarga> view = new BindingListView <ModelLibrary.ListaProdutosCarga>(produtos);

                localDepositoForm.grdCargaProduto.DataSource = view;

                if (produtos.Count == 0)
                {
                    localDepositoForm.mnuCargaExcluir.Visible = true;
                }
                else
                {
                    localDepositoForm.mnuCargaExcluir.Visible = false;
                }

                /// Ocultar colunas CargaId e cCargaProdutoGradeId
                localDepositoForm.grdCargaProduto.Columns[9].Visible  = false;
                localDepositoForm.grdCargaProduto.Columns[10].Visible = false;

                /// Exibir Coluna como "Moeda"
                localDepositoForm.grdCargaProduto.Columns[6].DefaultCellStyle.Format = "c";
                localDepositoForm.grdCargaProduto.Columns[7].DefaultCellStyle.Format = "c";

                /// Alterar Título da Coluna
                localDepositoForm.grdCargaProduto.Columns[0].HeaderText = "Código de Barras";
                localDepositoForm.grdCargaProduto.Columns[5].HeaderText = "Quantidade Retorno";
                localDepositoForm.grdCargaProduto.Columns[6].HeaderText = "Valor Saída";
                localDepositoForm.grdCargaProduto.Columns[7].HeaderText = "Valor Custo";
            }
            catch (Exception vE)
            {
                Trace.WriteLine(DateTime.Now.ToString() + "Carga.CarregarGradeCargaProduto()");
                Trace.TraceError(vE.Message);
                MessageBox.Show(vE.Message, vE.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #30
0
        ////////////////////////////////////////////
        /// Contas a Receber
        ////////////////////////////////////////////

        public void CarregarContasAReceber()
        {
            List <ModelLibrary.ListaAReceber> pedidos = ModelLibrary.MetodosDeposito.ObterListaAReceber(cRetornoId);

            BindingListView <ModelLibrary.ListaAReceber> view = new BindingListView <ModelLibrary.ListaAReceber>(pedidos);


            localDepositoForm.grdContasAReceber.DataSource = view;

            localDepositoForm.grdContasAReceber.Columns[0].Visible = false;
            localDepositoForm.grdContasAReceber.Columns[1].Visible = false;
            localDepositoForm.grdContasAReceber.Columns[4].Width   = 250;
            localDepositoForm.grdContasAReceber.Columns[5].DefaultCellStyle.Format = "c";
            localDepositoForm.grdContasAReceber.Columns[6].DefaultCellStyle.Format = "c";
        }
コード例 #31
0
ファイル: frmMyDlg.cs プロジェクト: tkir/webfont_notepad
        private void loadFontsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var fonts = (List <Font>)e.Result;

            fontsBindingListView = new BindingListView <Font>(fonts);

            //fontsListBox.BeginUpdate();
            fontsListBox.DataSource = fontsBindingListView;
            //fontsListBox.EndUpdate();

            fontsListBox.Enabled  = true;
            filterTextBox.Enabled = true;

            loadingProgressBar.Visible = false;
        }
コード例 #32
0
        private void _view_LoadData(object sender, EventArgs e)
        {
            using (new WaitCursorHandler())
            {
                if (_view.ListDataGrid != null)
                {
                    var listObjs = _services.GetStokBarangLogByDate(_view.DateTimePickerTanggal.Value).ToList();
                    _bindingView              = new BindingListView <StokBarangLogModel>(listObjs);
                    _bindingView.ListChanged += _bindingView_ListChanged;
                    SetLabelTotal(listObjs);

                    _view.ListDataGrid.DataSource = _bindingView;
                }
            }
        }
コード例 #33
0
ファイル: PublicFind.cs プロジェクト: Proerp/STS07JUL
        public PublicFind(BindingListView <DataMessageMaster> dataMessageMasterListView)
        {
            InitializeComponent();

            this.dataMessageMasterListView = dataMessageMasterListView;

            List <string> listFilterColumnID = new List <string> {
                EnumFilterColumnID.ProductionDate.Value, EnumFilterColumnID.LogoName.Value, EnumFilterColumnID.FactoryName.Value, EnumFilterColumnID.OwnerName.Value, EnumFilterColumnID.CategoryName.Value, EnumFilterColumnID.ProductName.Value, EnumFilterColumnID.CoilCode.Value, EnumFilterColumnID.CoilExtension.Value, EnumFilterColumnID.DataStatusID.Value, EnumFilterColumnID.Remarks.Value
            };

            this.FilterColumnID = EnumFilterColumnID.CoilCode.Value;

            this.comboBoxFilterColumnID.DataSource = listFilterColumnID;
            this.comboBoxFilterColumnID.DataBindings.Add("Text", this, "FilterColumnID", true);
        }
コード例 #34
0
        public string ShowDialogWithResult(IList <NotaDestinada> notasDestinadas)
        {
            if (notasDestinadas != null)
            {
                var listNotasDestinadas = notasDestinadas.ToList();
                ordenacao                     = TypeDescriptor.GetProperties(typeof(NotaDestinada))["Nsu"];
                viewNotasDestinadas           = new BindingListView <NotaDestinada>(listNotasDestinadas);
                dtgNotasDestinadas.DataSource = viewNotasDestinadas;

                viewNotasDestinadas.ApplySort(ordenacao, ListSortDirection.Ascending);
            }

            this.ShowDialog();
            return(result);
        }
コード例 #35
0
ファイル: Form1.cs プロジェクト: xuan2261/BindingListView
        public Form1()
        {
            InitializeComponent();

            // Create view of customers list
            BindingListView <Customer> view = new BindingListView <Customer>(GetCustomers());

            // Data bind to the view
            customerBindingSource.DataSource = view;

            // Change the orders binding source to use the auto provided view
            // instead of the normal list.
            ordersBindingSource.DataMember  = "OrdersView";
            detailsBindingSource.DataMember = "DetailsView";
        }
コード例 #36
0
        ////////////////////////////////////////////
        /// Pedidos
        ////////////////////////////////////////////

        public void CarregarPedidos(Boolean pAtual = true)
        {
            List <ModelLibrary.ListaPedidosRetorno> pedidos = ModelLibrary.MetodosDeposito.ObterListaPedidosRetorno(cRetornoId);

            BindingListView <ModelLibrary.ListaPedidosRetorno> view = new BindingListView <ModelLibrary.ListaPedidosRetorno>(pedidos);

            localDepositoForm.grdRetornoPedido.DataSource = view;

            localDepositoForm.grdRetornoPedido.Columns[1].Visible = false;
            localDepositoForm.grdRetornoPedido.Columns[2].Width   = 450;
            localDepositoForm.grdRetornoPedido.Columns[3].DefaultCellStyle.Format = "c";


            localDepositoForm.grdRetornoPedido.Refresh();
        }
コード例 #37
0
 public BindingListView<FixedSummServiceView> Find(ServiceOld serviceOld, LocalAddress address)
 {
     BindingListView<FixedSummServiceView> view = new BindingListView<FixedSummServiceView>();
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[2];
     parameters[0] = new System.Data.SqlClient.SqlParameter("@serviceId", System.Data.SqlDbType.BigInt);
     parameters[0].set_Value((long) serviceOld.Id);
     parameters[1] = new System.Data.SqlClient.SqlParameter("@addrId", System.Data.SqlDbType.BigInt);
     parameters[1].set_Value((long) address.Id);
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(this.SelectFields + " from [sn].[GetFixedSummServices](@serviceId ,@addrId) t", parameters).Rows)
     {
         FixedSummServiceView view2 = this.Load(row);
         view.Add(view2);
     }
     return view;
 }
コード例 #38
0
ファイル: NovyReceptForm.cs プロジェクト: oondriss/is-hemart
 public NovyReceptForm()
 {
     InitializeComponent();
     _dataManager             = new DataManager();
     _view                    = new BindingListView <ZoznamLiekovDTO>(_dataManager.GetLiekyDescBindingSource());
     _view2                   = new BindingListView <ZoznamLiekovDTO>(_dataManager.GetLiekyDescBindingSource());
     liek1Combo.DataSource    = _view;
     liek1Combo.DisplayMember = "Nazov";
     liek1Combo.ValueMember   = "ZoznamLiekovID";
     liek1Combo.SelectedIndex = -1;
     liek2Combo.DataSource    = _view2;
     liek2Combo.DisplayMember = "Nazov";
     liek2Combo.ValueMember   = "ZoznamLiekovID";
     liek2Combo.SelectedIndex = -1;
 }
コード例 #39
0
        /// <summary>
        /// Charge les données de la grille Diplome
        /// </summary>
        private void diplomeGridViewLoad()
        {
            List <Diplome> allDip = DiplomeDAO.findAll();
            List <Diplome> Dip    = new List <Diplome>();

            foreach (Diplome tempD in allDip)
            {
                Dip.Add(tempD);
            }
            BindingListView <Diplome> bindingSourceUe = new BindingListView <Diplome>(Dip);

            diplomeGridView.DataSource = bindingSourceUe;
            anneeGridViewLoad();
            periodeGridViewLoad();
        }
コード例 #40
0
        private void AddOrderItem()
        {
            var checkedElements = new List <BestelItems>();

            foreach (DataGridViewRow row in DgvData.Rows)
            {
                if (Convert.ToBoolean(row.Cells[0].Value))
                {
                    var currentIndex = items.ElementAt(row.Index);

                    var newValue = new BestelItems()
                    {
                        Benaming     = currentIndex.Afdeling,
                        Nummer       = currentIndex.Nummer,
                        Omschrijving = currentIndex.Omschrijving,
                        Voorraad     = currentIndex.Voorraad,
                        Soort        = "Stuks",
                        Prijs        = currentIndex.Prijs
                    };
                    checkedElements.Add(newValue);
                    BestelItemsComparer comparer = new BestelItemsComparer();
                    if (!BestelItemsList.Contains(newValue, comparer))
                    {
                        BestelItemsList.Add(newValue);
                    }
                }
            }
            for (int i = 0; i < BestelItemsList.Count; i++)
            {
                bool Present = false;
                for (int j = 0; j < checkedElements.Count; j++)
                {
                    BestelItemsComparer comparer = new BestelItemsComparer();
                    if (comparer.Equals(BestelItemsList[i], checkedElements[j]))
                    {
                        Present = true;
                    }
                }
                if (!Present)
                {
                    BestelItemsList.RemoveAt(i);
                }
            }
            BestelItemsList = BestelItemsList.OrderBy(item => item.Benaming).ToList();
            BindingListView <BestelItems> view = new BindingListView <BestelItems>(BestelItemsList);

            DgvLoadData(DgvBestellen, view);
        }
コード例 #41
0
        private void aButtonSearch_Click(object sender, EventArgs e)
        {
            aTextBoxNotes.Text = "";
            //GET SORTATION
            Class_Library.DataGridView.DGVSortInfo SavedSortation = DGVUtilities.GetSortation(aDataGridViewLicenses);

            if (aComboboxSortBy.SelectedItem.ToString() == @"Search by Name\Id")
            {
                // GET DATA BY NAME
                LicensesDGV = DataAccess_GDataTable.GetByName(aTextBoxSearch.Text, Config.DBDir_Name);
            }
            else if (aComboboxSortBy.SelectedItem.ToString() == "Search by Machine Name")
            {
                // GET DATA BY MACHINE NAME
                List <LicensedMachines> LicenseFound = DataAccess_LicensedMachinesTable.GetByMachineName(aTextBoxSearch.Text, Config.DBDir_Name);
                try
                {
                    // FIND LICENSES BY MACHINE'S LICENSE ID
                    List <License> TempLicensesDGV = new List <License>();
                    foreach (LicensedMachines _Lic in LicenseFound)
                    {
                        // COMPILE LIST FOR DGV
                        TempLicensesDGV.Add(DataAccess_GDataTable.GetByID(_Lic.LicenseId, Config.DBDir_Name));
                    }
                    // MOVE LIST TO DGV
                    LicensesDGV = TempLicensesDGV;
                }
                catch (ArgumentOutOfRangeException)
                {
                }
            }

            // PUT DATA INTO SORTABLE LIST
            BindingListView <License> SortableLicensesDGV = new BindingListView <License>(LicensesDGV);

            // SET DGV.DATASOURCE
            aDataGridViewLicenses.DataSource = SortableLicensesDGV;
            aLabelLicenseFoundInt.Text       = aDataGridViewLicenses.Rows.Count.ToString();
            // SET SORTATION
            DGVUtilities.SetSortation(SavedSortation, aDataGridViewLicenses);
            Utilities.CloseSQLConnection();

            // If no licenses were found, clear the notes text box.
            if (aDataGridViewLicenses.RowCount == 0)
            {
                aTextBoxNotes.Text = "";
            }
        }
コード例 #42
0
        public frmViewFriends(List<DailyMileFriend> friendEntries, DailyMileAPI api, string logedInUser)
            : base()
        {
            _api = api;
            _loggedInUser = logedInUser;
            BindingListView<DailyMileFriend> friends = new BindingListView<DailyMileFriend>(friendEntries);
            friends.SortFields = "Display_Name";

            InitializeComponent();

            display_nameComboBox.DataSource = friends.GetList();
            if (friendEntries.Count > 0)
            {
                display_nameComboBox.SelectedIndex = 0;
                UpdateControls();
            }
        }
コード例 #43
0
        private void btnViewEntries_Click(object sender, EventArgs e)
        {
            string dataPath;
            string fileName;
            DailyMileEntries entries;

            dataPath = HelperFunctions.GetAssemblyRunPath();
            dataPath += "\\Data\\Friends";
            DailyMileFriend friend = display_nameComboBox.SelectedItem as DailyMileFriend;

            fileName = string.Format("{0}\\Dailymile_{1}_Entries.dat", dataPath, friend.Username);

            entries = DailyMileAPI.GetStoredEntries(fileName);

            BindingListView<DailyMileEntry> viewEntries = new BindingListView<DailyMileEntry>(entries.Entries);
            frmViewEntries frmView = new frmViewEntries(_api, _loggedInUser, viewEntries, frmViewEntries.enumViewType.Friend);
            frmView.Text = "DMBackUp - View Friends Entries";
            frmView.Show();
        }
コード例 #44
0
ファイル: UAUserInterface.cs プロジェクト: timshao1120/wtgw
    public UAUserInterface(UAEngine xa)
    {
        InitializeComponent();

        //When xa is loaded settings are loaded..
        this.xa = xa;

        //SetState sets up the different check boxes based on the settings.
        SetState();

        //Setting the textbox with the default value.
        this.tbCanary.Text = xa.Settings.canary;

        //Setup the databinding for results view
        this.matches = new SortableBindingList<ResponseResult>();
        this.view = new BindingListView<ResponseResult>(this.matches);
        this.ResultsDataGridView.DataSource = this.view;

        //Some other defaults
        this.lbDomainFilters.DataSource = xa.Settings.domainFilters;
        this.dgUnicodeTestMappings.DataSource = xa.Settings.UnicodeTestMappings.GetAll();

        //Add the default items to the filter ComboBox.
        this.cbFilter.Items.Add("All");
        this.cbFilter.Items.Add("Transformable");
        this.cbFilter.Items.Add("Traditional");
        this.cbFilter.Items.Add("Overlong");
        this.cbFilter.SelectedItem = "Traditional";

        // Initialize the throttle UI values
        this.tbBatchSize.Text = String.Format("{0}", this.xa.Settings.throttleBatchSize);
        this.tbDelayPeriod.Text = String.Format("{0}", this.xa.Settings.throttleDelayPeriod);

        //Delegate method to ensure when adding data to the datasource it origanates from the creating thread.
        ar = new AddRow(AddRowMethod);

        //Set columns to sortable
        this.scas = new SetColumnAutoSort(setColumnAutoSort);
        this.Dock = DockStyle.Fill;
    }
コード例 #45
0
ファイル: Form1.cs プロジェクト: bitpulse/syslogserver
        internal void ApplyFilter(BindingListView<Message> view)
        {
            Predicate<Message> predicate = msg => true;

            if (facilities.Any())
            {
                Predicate<Message> predicateFacility = msg => false;
                foreach (FacilityType item in facilities)
                    predicateFacility = predicateFacility.Or(msg => msg.Facility == item);
                predicate = predicate.And(predicateFacility);
            }

            if (severities.Any())
            {
                Predicate<Message> predicateSeverity = msg => false;
                foreach (SeverityType item in severities)
                    predicateSeverity = predicateSeverity.Or(msg => msg.Severity == item);
                predicate = predicate.And(predicateSeverity);
            }

            if (contents.Any())
            {
                Predicate<Message> predicateContents = msg => false;
                foreach (string item in contents)
                    predicateContents = predicateContents.Or(msg => msg.Content.ToLower().Contains(item.ToLower()));
                predicate = predicate.And(predicateContents);
            }

            if (hosts.Any())
            {
                Predicate<Message> predicateHosts = msg => false;
                foreach (string item in hosts)
                    predicateHosts = predicateHosts.Or(msg => msg.Hostname.ToLower().Contains(item.ToLower()));
                predicate = predicate.And(predicateHosts);
            }

            view.ApplyFilter(predicate);
        }
コード例 #46
0
ファイル: FactorsSettings.cs プロジェクト: emanuelshv/tupux
 private void LoadFactors()
 {
     _factors = UMLFactorCollection.GetFactors(false);
     BindingListView<UMLFactor> view = new BindingListView<UMLFactor>(_factors);
     this.uMLFactorCollectionBindingSource.DataSource = view;            
     view.RemovingItem += new RemoveEventHandler<UMLFactor>(view_RemovingItem);
 }
コード例 #47
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindIncludeRoleRightsBy(User user, OldRole r)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[2];
     parameters[0] = new System.Data.SqlClient.SqlParameter("@name", System.Data.SqlDbType.VarChar);
     parameters[0].set_Value(user.Login);
     parameters[1] = new System.Data.SqlClient.SqlParameter("@role", System.Data.SqlDbType.VarChar);
     parameters[1].set_Value((long) r.Id);
     string sql = this.SelectQuery + "       inner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n                                                inner join sn.RolesView rv on rv.id = rm.member_principal_id\r\n                                                inner join sys.database_role_members rm2 on rv.id = rm2.role_principal_id /*and rv.typeRole in ('РОЛЬ')*/ and rv.id = @role\r\n                                                inner join sys.database_principals pr on rm2.member_principal_id = pr.principal_id and pr.type = 'S' and pr.name = @name\r\n                                        ";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #48
0
ファイル: RoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<Role> FindIncludeRightsBy(User user)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@userId", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((long) user.Id);
     string sql = this.SelectQuery + "\tinner join sn.UserRights ur on ur.RightId = t.id\r\n\tinner join sn.Users u on ur.UserId = u.id\r\nwhere u.id = @userId and t.TypeId not in (select id from sn.RightTypes where [name] like 'Роль%')";
     BindingListView<Role> view = new BindingListView<Role>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         Role owid = new Role();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #49
0
ファイル: frmMyDlg.cs プロジェクト: WebFont/webfont_notepad
        private void loadFontsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var fonts = (List<Font>)e.Result;

            fontsBindingListView = new BindingListView<Font>(fonts);

            //fontsListBox.BeginUpdate();
            fontsListBox.DataSource = fontsBindingListView;
            //fontsListBox.EndUpdate();

            fontsListBox.Enabled = true;
            filterTextBox.Enabled = true;

            loadingProgressBar.Visible = false;
        }
コード例 #50
0
ファイル: RoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<Role> FindIncludeRolesBy(User user)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@name", System.Data.SqlDbType.VarChar) };
     parameters[0].set_Value(user.Login);
     string sql = this.RoleSelectQuery + " \t\tinner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n\t\t                                        inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                        where pr.type='S' and t.typeRole in ('РОЛЬ') and pr.[name] =  @name";
     BindingListView<Role> view = new BindingListView<Role>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         Role owid = new Role();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #51
0
ファイル: RoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<Role> FindIncludeRolesBy(Role role)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@id", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((int) role.Id);
     string sql = this.SelectQuery + " inner join sn.RightGroups rg on rg.RightId = t.id\r\n                                          where\trg.GroupId = @id";
     BindingListView<Role> view = new BindingListView<Role>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         Role owid = new Role();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #52
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> GetRoles(string typeRole)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@typeRole", System.Data.SqlDbType.VarChar) };
     parameters[0].set_Value(typeRole);
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(this.SelectQuery + " where typeRole = @typeRole", parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #53
0
ファイル: RoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<Role> GetRoles(RightTypesEnum rType)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@type", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((long) rType);
     BindingListView<Role> view = new BindingListView<Role>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(this.SelectQuery + " where TypeId = @type", parameters).Rows)
     {
         Role owid = new Role();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #54
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindIncludeRolesBy(User user)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@name", System.Data.SqlDbType.VarChar) };
     parameters[0].set_Value(user.Login);
     string sql = this.SelectQuery + " \r\n                                                inner join sys.database_role_members rm on t.id = rm.role_principal_id \r\n\t\t                                        inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                        where pr.type='S' /*and t.typeRole in ('РОЛЬ')*/ and pr.[name] =  @name\r\n                                        union\r\n                                        " + this.SelectQueryAR + "\r\n                                                               inner join sn.UserRights ur on tar.id = ur.RightId\r\n                                                               inner join sn.Users u on ur.UserId = u.id and u.login = @name\r\n\t                                            where tar.TypeId = 4";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #55
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                if (treeView1.SelectedNode == this.allStocksNode)
                {
                    this.toolStripButton_filterInsuff.Enabled = true;

                    BindingList<Model_ViewResult> modelList = new BindingList<Model_ViewResult>();

                    foreach (string fileName in Directory.GetFiles(Config.STAT_PATH_DEFAULT))
                    {
                        if (fileName.EndsWith(".xml") && !fileName.EndsWith(Statistic.FAKE_FILE_FILE_NAME + ".xml"))
                        {
                            try
                            {
                                Statistic eachStat = (Statistic)XMLHelper.ObjectFromXML(fileName, typeof(Statistic));
                                Model_ViewResult eachItemInTable = new Model_ViewResult(eachStat);
                                modelList.Add(eachItemInTable);
                            }
                            catch (Exception ex)
                            {
                                LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                            }
                        }
                    }

                    BindingListView<Model_ViewResult> temp = new BindingListView<Model_ViewResult>(modelList);
                    this.dataGridView1.DataSource = temp;
                    if (portfolioLinked) maintainPortfolioLinkage();
                }
                else if (treeView1.SelectedNode == this.mainNode)
                {
                    this.toolStripButton_filterInsuff.Enabled = false;
                    this.dataGridView1.DataSource = null;
                }
                else
                {
                    this.toolStripButton_filterInsuff.Enabled = false;
                    string clusterPath = Config.CLUSTER_PATH_DEFAULT + treeView1.SelectedNode.Name;

                    if (File.Exists(clusterPath))
                    {
                        if (clusterPath.EndsWith(".xml"))
                        {
                            // **********
                            // Binding list view by http://blw.sourceforge.net/
                            // **********

                            Cluster cluster = XMLHelper.ClusterFromXML(clusterPath);
                            BindingList<Model_ViewResult> modelList = new BindingList<Model_ViewResult>();

                            foreach (int eachStockCode in cluster.stockCodeList)
                            {
                                string statPath = Config.STAT_PATH_DEFAULT + @"\" + eachStockCode + ".xml";

                                Statistic eachStat = (Statistic)XMLHelper.ObjectFromXML(statPath, typeof(Statistic));
                                Model_ViewResult eachItemInTable = new Model_ViewResult(eachStat);
                                modelList.Add(eachItemInTable);
                            }

                            BindingListView<Model_ViewResult> temp = new BindingListView<Model_ViewResult>(modelList);
                            this.dataGridView1.DataSource = temp;
                            if (portfolioLinked) maintainPortfolioLinkage();
                        }
                        else
                        {
                            return;
                        }

                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                MessageBox.Show("Statistic files corrupted, please rerun compile statistic module.",
                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #56
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindExcludeRightsBy(User user)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@name", System.Data.SqlDbType.VarChar) };
     parameters[0].set_Value(user.Login);
     string sql = this.SelectQuery + " where\t/*t.typeRole in ('РОЛЬ','ПРАВО') \r\n                                                and*/ not t.id in  (\tselect\tt.id\r\n\t                                                                from\tsn.RolesView t\r\n                                                                            inner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n\t\t                                                                    inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                                                                inner join sys.database_role_members rm2 on pr.principal_id = rm2.role_principal_id\r\n\t\t                                                                        inner join sys.database_principals pr2 on rm2.member_principal_id = pr2.principal_id\r\n                                                                                    inner join sys.database_role_members rm3 on pr2.principal_id = rm3.role_principal_id\r\n\t\t                                                                            inner join sys.database_principals pr3 on rm3.member_principal_id = pr3.principal_id\r\n                                                                                        inner join sys.database_role_members rm4 on pr3.principal_id = rm4.role_principal_id\r\n\t    \t                                                                            inner join sys.database_principals pr4 on rm4.member_principal_id = pr4.principal_id\r\n                                                                    where pr4.type='S' \r\n                                                                          /*and t.typeRole in ('РОЛЬ','ПРАВО') */\r\n                                                                          and pr4.[name] = @name  \r\n                                                                    union\r\n                                                                    select\tt.id\r\n\t                                                                from\tsn.RolesView t\r\n                                                                            inner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n\t\t                                                                    inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                                                                inner join sys.database_role_members rm2 on pr.principal_id = rm2.role_principal_id\r\n\t\t                                                                        inner join sys.database_principals pr2 on rm2.member_principal_id = pr2.principal_id\r\n                                                                                    inner join sys.database_role_members rm3 on pr2.principal_id = rm3.role_principal_id\r\n\t\t                                                                            inner join sys.database_principals pr3 on rm3.member_principal_id = pr3.principal_id\r\n                                                                    where pr3.type='S' \r\n                                                                          /*and t.typeRole in ('РОЛЬ','ПРАВО') */\r\n                                                                          and pr3.[name] = @name\r\n                                                                    union \r\n                                                                    select\tt.id\r\n\t                                                                from\tsn.RolesView t\r\n                                                                            inner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n\t\t                                                                    inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                                                                inner join sys.database_role_members rm2 on pr.principal_id = rm2.role_principal_id\r\n\t\t                                                                        inner join sys.database_principals pr2 on rm2.member_principal_id = pr2.principal_id\r\n                                                                    where pr2.type='S' \r\n                                                                          /*and t.typeRole in ('РОЛЬ','ПРАВО') */\r\n                                                                          and pr2.[name] = @name\r\n                                                                    union\r\n                                                                    select\tt.id\r\n\t                                                                from\tsn.RolesView t\r\n                                                                            inner join sys.database_role_members rm on t.id = rm.role_principal_id\r\n\t\t                                                                    inner join sys.database_principals pr on rm.member_principal_id = pr.principal_id\r\n                                                                    where pr.type='S' \r\n                                                                          /*and t.typeRole in ('РОЛЬ','ПРАВО') */\r\n                                                                          and pr.[name] = @name)  ";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #57
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindExcludeRolesBy(OldRole role)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@id", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((long) role.Id);
     string sql = this.SelectQuery + " where\t/*t.typeRole in ('РОЛЬ','ПРАВО')\r\n\t\t                            and*/ t.id <> @id\r\n                                    and not t.id in\t(select role_principal_id\r\n\t\t\t\t\t                                 from\tsys.database_role_members \r\n\t\t\t\t\t                                 where\tmember_principal_id = @id)";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #58
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindExcludeRightsCurrentUser()
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[0];
     string sql = this.SelectField + " from sn.GetExcludeUserRoles t ";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #59
0
ファイル: OldRoleMapper.cs プロジェクト: u4097/SQLScript
 public BindingListView<OldRole> FindIncludeRolesBy(OldRole role)
 {
     System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@id", System.Data.SqlDbType.BigInt) };
     parameters[0].set_Value((long) role.Id);
     string sql = this.SelectQuery + " inner join sys.database_role_members rm on t.id = rm.role_principal_id \r\n                                          where\trm.member_principal_id = @id";
     BindingListView<OldRole> view = new BindingListView<OldRole>();
     foreach (System.Data.DataRow row in DALSql.ExecuteDataTable(sql, parameters).Rows)
     {
         OldRole owid = new OldRole();
         this.Load(row, owid);
         view.Add(owid);
     }
     return view;
 }
コード例 #60
0
ファイル: IISManagerFrm.cs プロジェクト: Jiyuu/IISMGR
        private void RefreshData()
        {
            var sites = sm.Sites;
            var appPools = sm.ApplicationPools;
            var tmpList = new List<SiteRecord>();
            BindingListView<SiteRecord> tmpView;

            foreach (var site in sm.Sites)
            {
                var record = new SiteRecord();
                var pool = appPools.SingleOrDefault(a => a.Name == site.Applications[0].ApplicationPoolName);
                var application = site.Applications[0];
                if (pool == null)
                {
                    System.Diagnostics.Trace.WriteLine(string.Format("no app pool for site {0}", site.Name));
                    continue;
                }
                record.Site = site;
                record.Application = application;
                record.Name = site.Name;
                record.ID = site.Id;
                record.SiteState = site.State;
                record.AppPoolName = application.ApplicationPoolName;
                record.AppPool = pool;
                record.AppPoolState = pool.State;
                record.Path = application.VirtualDirectories[0].PhysicalPath;
                record.VDir = application.VirtualDirectories[0];
                record.Populate();
                tmpList.Add(record);
            }
            sitesGrid.AutoGenerateColumns = false;

            tmpView = new BindingListView<SiteRecord>(tmpList);

            siteRecords = tmpList;
            siteRecordsView = tmpView;

            sitesGrid.DataSource = siteRecordsView;
        }