示例#1
0
        public MainForm()
        {
            InitializeComponent();

            // TODO: Add constructor code after the InitializeComponent() call.
            dataManager = DataManager.Singleton;
            dataManager.Initialize();

            headers = new ColumnHeaders();
            headers.Read();

            fixtures = new FieldFixtures();
            fixtures.Read();

            columnSelectionForm = new ColumnSelectionForm(headers, dataManager);

            personelGridView.AutoGenerateColumns = false;

            foreach(string colName in headers.headers.Keys)
            {
                int colidx = personelGridView.Columns.Add(colName, headers.Get(colName));
                personelGridView.Columns[colidx].DataPropertyName = colName;
                personelGridView.Columns[colidx].SortMode = DataGridViewColumnSortMode.Automatic;
            }

            SyncVisibleColumns();

            List<SoldierRecord> soldierList = dataManager.ReadSoldiers();
            soldiersBindingList = new SortableBindingList<SoldierRecord>(soldierList);
            bindingSource1.DataSource = soldiersBindingList;
        }
示例#2
0
        public GridBaseForm(SortableBindingList<object> data, Type dataType)
        {
            InitializeComponent();

            DataType = dataType;
            Data = data;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            #region Initialize Servers
            _servers = new SortableBindingList<Dota2Server>();
            _servers.Add(new Dota2Server("syd.valve.net", "Australia (Sydney)"));
            _servers.Add(new Dota2Server("200.73.67.1", "Chile (Santiago)"));
            _servers.Add(new Dota2Server("dxb.valve.net", "Dubai (UAE)"));
            _servers.Add(new Dota2Server("vie.valve.net", "Europe East 1 (Vienna, Austria)"));
            _servers.Add(new Dota2Server("185.25.182.1", "Europe East 2 (Vienna, Austria)"));
            _servers.Add(new Dota2Server("lux.valve.net", "Europe West 1 (Luxembourg)"));
            _servers.Add(new Dota2Server("146.66.158.1", "Europe West 2 (Luxembourg)"));
            _servers.Add(new Dota2Server("116.202.224.146", "India (Kolkata)"));
            _servers.Add(new Dota2Server("191.98.144.1", "Peru (Lima)"));
            _servers.Add(new Dota2Server("sto.valve.net", "Russia 1 (Stockholm, Sweden"));
            _servers.Add(new Dota2Server("185.25.180.1", "Russia 2 (Stockholm, Sweden)"));
            _servers.Add(new Dota2Server("sgp-1.valve.net", "SE Asia 1 (Singapore)"));
            _servers.Add(new Dota2Server("sgp-2.valve.net", "SE Asia 2 (Singapore)"));
            _servers.Add(new Dota2Server("cpt-1.valve.net", "South Africa 1 (Cape Town)"));
            _servers.Add(new Dota2Server("197.80.200.1", "South Africa 2 (Cape Town)"));
            _servers.Add(new Dota2Server("197.84.209.1", "South Africa 3 (Cape Town)"));
            _servers.Add(new Dota2Server("196.38.180.1", "South Africa 4 (Johannesburg)"));
            _servers.Add(new Dota2Server("gru.valve.net", "South America 1 (Sao Paulo)"));
            _servers.Add(new Dota2Server("209.197.25.1", "South America 2 (Sao Paulo)"));
            _servers.Add(new Dota2Server("209.197.29.1", "South America 3 (Sao Paulo)"));
            _servers.Add(new Dota2Server("iad.valve.net", "US East (Sterling, VA)"));
            _servers.Add(new Dota2Server("eat.valve.net", "US West (Seattle, WA)"));
            #endregion

            BindingSource bs = new BindingSource();
            bs.DataSource = _servers;
            dataGrid.DataSource = bs;
            RefreshGrid();

            ConsoleWrite("Program started successfully.", Color.Lime);
        }
示例#4
0
        public StockReaderForm()
        {
            InitializeComponent();
            stockDataGridView.AutoGenerateColumns = false;
            LoadConfigInfo();
            BindColumns();

            notifyIcon1.Visible = false;

            dataList = new SortableBindingList<TickerData>();

            portfolioPath = "";
            if (portfolio != null)
                ProcessTickers();

            sortColumn = stockDataGridView.Columns[0];
            sortOrder = stockDataGridView.SortOrder;

            //int interval = info.TimerInterval;

            if (config.ConfigData.Timer.interval <= 0)
            {
                tickerTimer.Interval = 60000;  // default to 1 minute
            }
            else
            {
                tickerTimer.Interval = config.ConfigData.Timer.interval * 60000;
            }

            tickerTimer.Enabled = true;
        }
示例#5
0
        private void CodeTB_TextChanged(object sender, EventArgs e)
        {
            //фільтруємо по коду
            if (CodeTB.Text.Length > 0)
            {
                List<WareView> viewList = new List<WareView>();
                if (CodeTB.Text.Length > 0)
                    viewList = view.Where(a => a.WareCodesStringForSearch.StartsWith("<" + CodeTB.Text))
                        .ToList();
                else
                    viewList = view.ToList();
                SortableBindingList<WareView> filteredView = new SortableBindingList<WareView>(viewList);

                WareLUE.Properties.DataSource = filteredView;
                if (filteredView.Count > 0)
                    WareLUE.ItemIndex = 0;
            }
            else
            {
                List<WareView> viewList = new List<WareView>();
                viewList = view.ToList();
                SortableBindingList<WareView> filteredView = new SortableBindingList<WareView>(viewList);

                WareLUE.Properties.DataSource = filteredView;
                if (filteredView.Count > 0)
                    WareLUE.ItemIndex = 0;
            }
        }
示例#6
0
        /// <summary>
        /// main form constructor
        /// </summary>
        public MainForm()
        {
            FindPositionRow = 0;
            _refreshFilterTimeBuff = new TimeBuffer(RefreshFilter, TimeSpan.FromMilliseconds(500));
            string strDateTimeFormat = ConfigurationManager.AppSettings["GridDateTimeFormat"];
            if (strDateTimeFormat != null)
                DATE_TIME_FORMAT = strDateTimeFormat;

            _engine.InitEngine();

            try
            {
                InitializeComponent();

                foreach (LogBehavior b in _engine.Behaviors)
                {
                    cmbBehaviors.Items.Add(b);
                }

                _gridModel = new SortableBindingList<LogEntry>(_engine.MainView);
                dataGridView1.DataSource = _gridModel;

                lblMemory.Text = "Used Ram: " + ((double)Process.GetCurrentProcess().WorkingSet64 / 1000000d).ToString(".00") + " MB";
                dataGridView1.AutoGenerateColumns = false;
                cmbBehaviors.SelectedItem = LogBehavior.AutoDetectBehaviour;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace, "Error");
            }
        }
        private void pbxExport_Click(object sender, EventArgs e)
        {
            var obectList = gridData.DataSource as List<DailyPayment>;
            var lst = new SortableBindingList<object>(obectList.Cast<object>().ToList());

            TaxOrderGenerator.ExportToExcel(lst, typeof(DailyPayment));
        }
示例#8
0
        private SortableBindingList<Para> m_parasList; //a list store parameters' information

        #endregion Fields

        #region Constructors

        /// <summary>
        /// constructor of ParametersFactory
        /// </summary>
        /// <param name="element">the element of which parameters will be gotten</param>
        public ParasFactory(Element element)
        {
            m_element = element;
            m_parasList = new SortableBindingList<Para>();
            //set m_parasList can be edit;
            m_parasList.AllowEdit = true;
        }
示例#9
0
 protected override void DefinirDados()
 {
     base.DefinirDados();
     Dados = null;
     Dados = new SortableBindingList<Definicao.Escala>(ctrl.Navegar());
     dtgDados.Focus();
 }
示例#10
0
 internal void Update()
 {
     var typeList = _model.GetTypesFromGroup(_groupID);
     var infoList = new SortableBindingList<EveTypeInfo>();
     foreach (var type in typeList)
         infoList.Add(EveTypeInfoRepository.GetEveTypeInfo(type));
        _list.DataObject = infoList;
 }
示例#11
0
 public SettingsFile()
 {
     _Games = new SortableBindingList<x360ce.Engine.Data.Game>();
     _Games.AddingNew += _Games_AddingNew;
     _Games.ListChanged += _Games_ListChanged;
     _Programs = new SortableBindingList<x360ce.Engine.Data.Program>();
     _Pads = new SortableBindingList<x360ce.Engine.Data.PadSetting>();
 }
		public CloudStorageUserControl()
		{
			InitializeComponent();
			data = new SortableBindingList<CloudItem>();
			TasksDataGridView.DataSource = data;
			queueTimer = new JocysCom.ClassLibrary.Threading.QueueTimer(500, 1000);
			queueTimer.DoAction = DoAction;
		}
 public BuiltInParamsCheckerForm(
     string description,
     SortableBindingList<BuiltInParamsChecker.ParameterData> data)
 {
     _data = data;
       InitializeComponent();
       Text = description + " " + Text;
 }
        private void FrmObjectsWithoutDescription_Load(object sender, EventArgs e)
        {
            this.boundList = new SortableBindingList<IDbObject>(this.database.FindObjectsWithoutDescriptionInDatabase());

            this.gvObjects.AutoGenerateColumns = false;
            this.gvObjects.DataSource = this.boundList;

            this.lnkCopyToClipboard.Visible = false;
        }
        public CommandersLog(Form1 callingForm)
        {
            _callingForm = callingForm;
            
            LogEvents = new SortableBindingList<CommandersLogEvent>();

            isLoaded = false;

        }
示例#16
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="viewer"></param>
        public ObjectViewerForm(ObjectViewer viewer)
        {
            InitializeComponent();

            m_viewer = viewer;
            m_paras = viewer.Params;
            m_currentSketch = viewer.CurrentSketch3D;

            Application.AddMessageFilter(this);
        }
示例#17
0
 public Race()
 {
     this.ID = DataManager.getNextID();
     this.type = "";
     this.competitorRaceList = new SortableBindingList<CompetitorRace>();//new BindingList<CompetitorRace>();
     //this.competitorRaceList = new BindingList<CompetitorRace>();
     this.validClasses = new BindingList<Class>();
     this.passings = new BindingList<PassingsInfo>();
     this.dates = new BindingList<DateTime>();
 }
示例#18
0
		//*/

		public void Init()
		{
			RefreshRegions();
			regionViewBindingSource = new BindingSource();
			var sortableList = new SortableBindingList<RegionView>(regions);
			regionViewBindingSource.DataSource = sortableList;

			dataGridView1.DataSource = regionViewBindingSource;
			RefreshGrid();
		}
示例#19
0
 public TapesClass(DataGridView gr, NeedleClass ndl, CNC c, FormMain MainF)
 {
     Grid = gr;
     Needle = ndl;
     MainForm = MainF;
     Cnc = c;
     TapeTypes = AForgeFunctionSet.GetTapeTypes();
     if (File.Exists(Global.BaseDirectory + @"\" + TapesSaveName))
         tapeObjs = Global.DeSerialization<SortableBindingList<TapeObj>>(TapeFilename);
 }
示例#20
0
		void NewDeviceForm_Load(object sender, EventArgs e)
		{
			EngineHelper.EnableDoubleBuffering(MySettingsDataGridView);
			configs = new SortableBindingList<Summary>();
			MySettingsDataGridView.AutoGenerateColumns = false;
			MySettingsDataGridView.DataSource = configs;
			WizzardTabControl.TabPages.Remove(Step2TabPage);
			SearchRadioButton.Checked = true;
			FolderPathTextBox.Text = new FileInfo(Application.ExecutablePath).DirectoryName;
			SearchTheInternetCheckBox.Checked = SearchRadioButton.Checked && MainForm.Current.OptionsPanel.InternetCheckBox.Checked;
		}
        public void Fillcombobox(SortableBindingList<CategoryModel> categoryList, ComboBox categoryComboBox)
        {
            categoryComboBox.Items.Clear();
            categoryComboBox.Items.Insert(0, "geen categoriefilter");
            categoryComboBox.SelectedIndex = 0;

            foreach (var category in categoryList)
            {
                categoryComboBox.Items.Add(category.Name);
            }
        }
        public SortableBindingList<Auction> LoadMyAuctions()
        {
            var results = new SortableBindingList<Auction>();
            var items = Context.Auctions.AsQueryable();
            foreach (var res  in items)
            {
                results.Add(res.ToDomainObject());
            }

            return results;
        }
示例#23
0
 /// <summary>
 /// 审计财务数据项
 /// </summary>
 public IList<CaiWuItem> Audit(IList<CaiWuItem> caiWus, IList<GuoKuItem> guoKus)
 {
     //按顺序调用审计策略
     var normal = new NormalAuditForCaiWu();
     var amountWithCount = new AmountWithCountAuditForCaiWu(normal);
     var numberWithAmount = new NumberWithAmountAuditForCaiWu(amountWithCount);
     //执行审计
     var result = numberWithAmount.Filter(caiWus, guoKus);
     //转换为可排序列表
     var sort = new SortableBindingList<CaiWuItem>(result.Item1);
     return sort;
 }
示例#24
0
        private void addCourseTabs()
        {
            SortableBindingList<StudentViewModel> students = new SortableBindingList<StudentViewModel>(gradeTotalsVM.Students);

            foreach (KeyValuePair<Guid, String> entry in gradeTotalsVM.Courses)
            {
                TabPage tab = new TabPage(entry.Value);
                totalGradesTabControl.TabPages.Add(tab);

                tab.Controls.Add(new GradeTotalsGrid(entry.Key, students, gradeTotalsVM.GradingPeriods));
            }
        }
示例#25
0
        public LocationManager()
        {
            //if we have saved data, load it
            _locations = File.Exists(FileName) ? Global.DeSerialization<SortableBindingList<NamedLocation>>(FileName) : new SortableBindingList<NamedLocation>();

            //ensure default locations are present
            foreach (var x in _defaultLocations.Where(x => !LocationIsSet(x))) {
                AddLocation(0, 0, x);
            }

            //setup event handling
            foreach (var x in _locations) x.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ChildPropertyChangedCallback);
        }
        public BuiltInParamsCheckerFormListView(Element element,
            string description,
            SortableBindingList<ParameterData> data)
        {
            _data = data;
              InitializeComponent();
              Text = description + " " + Text;

              _listViewItemSorter = new ListViewItemSorter();
              lvParameters.ListViewItemSorter = _listViewItemSorter;

            tslElementType.Text = element.GetType().ToString();
        }
示例#27
0
 public void LoadAll()
 {
     try
     {
         _produits = _produitService.ListProduitStock();
         produitBindingSource.DataSource = _produits;
         dgvProduits.DataSource = produitBindingSource;
         IsShowPrintButton = dgvProduits.RowCount > 0;
     }
     catch (Exception exception)
     {
         GestionException.TraiterException(exception, "Liste des produits");
     }
 }
示例#28
0
 private void LoadAllChannels()
 {
     try
     {
         _deletedChannels = new List<GuideChannel>();
         _guideChannels = new SortableBindingList<GuideChannel>(Proxies.GuideService.GetAllChannels(this.ChannelType).Result);
         _channelsBindingSource.DataSource = _guideChannels;
         _channelsBindingSource.ResetBindings(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void LoadAllCommands()
 {
     try
     {
         _deletedCommands = new List<ProcessingCommand>();
         _processingCommands = new SortableBindingList<ProcessingCommand>(Proxies.SchedulerService.GetAllProcessingCommands().Result);
         _commandsBindingSource.DataSource = _processingCommands;
         _commandsBindingSource.ResetBindings(false);
         UpdateSelectedCommand();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void LoadAllPlugins()
 {
     try
     {
         _deletedServices = new List<PluginService>();
         _pluginServices = new SortableBindingList<PluginService>(Proxies.ControlService.GetAllPluginServices(false).Result);
         _servicesBindingSource.DataSource = _pluginServices;
         _servicesBindingSource.Sort = priorityDataGridViewTextBoxColumn.DataPropertyName +  " DESC";
         _servicesBindingSource.ResetBindings(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#31
0
        public SettingsData(string fileName, bool userLevel = false, string comment = null)
        {
            Items    = new SortableBindingList <T>();
            _Comment = comment;
            var specialFolder = userLevel
                                ? Environment.SpecialFolder.ApplicationData
                                : Environment.SpecialFolder.CommonApplicationData;
            var file = string.IsNullOrEmpty(fileName)
                                ? string.Format("{0}.xml", typeof(T).Name)
                                : fileName;
            var folder = string.Format("{0}\\{1}\\{2}",
                                       Environment.GetFolderPath(specialFolder),
                                       Application.CompanyName,
                                       Application.ProductName);
            var path = Path.Combine(folder, file);

            _XmlFile = new FileInfo(path);
        }
示例#32
0
        private void LoadHedged()
        {
            SortableBindingList <RealTimePositionObject> tmp = new SortableBindingList <RealTimePositionObject>();

            tmp.Load(AllRealTimePositions);
            HedgedRealTimePositions.Clear();

            //now remove the non Hedge
            foreach (RealTimePositionObject rt in tmp)
            {
                if (rt.ContainsHedge)
                {
                    HedgedRealTimePositions.Add(rt);
                }
            }

            HedgedRealTimePositions.Sort("HedgedSortField", ListSortDirection.Descending);
        }
示例#33
0
        public void CargarListadoObservaciones()
        {
            try
            {
                int anho = int.Parse(this.cboAnho.SelectedValue.ToString());
                int mes  = int.Parse(this.cboMes.SelectedValue.ToString());

                var lstUiObservaciones = new LN.ObservacionEmpleado().Listar(anho, mes);

                var sorted = new SortableBindingList <BE.UI.ObservacionEmpleado>(lstUiObservaciones);

                this.dgvObservaciones.DataSource = sorted;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#34
0
        public void GetAsistentes()
        {
            var asistentes = dataService.GetAllAsistentes();

            if (filtroSeleccionado != null)
            {
                var param     = Expression.Parameter(typeof(Asistente), "x");
                var predicate = Expression.Lambda <Func <Asistente, bool> >(
                    Expression.Call(
                        Expression.Call(
                            Expression.PropertyOrField(param, filtroSeleccionado.CampoFiltrado),
                            "ToUpper", null),
                        "Contains", null, Expression.Constant(filtroSeleccionado.TextoFiltrado.ToUpper())
                        ), param);
                asistentes = asistentes.AsQueryable().Where(predicate).ToList();
            }
            asistentesBinding = new SortableBindingList <Asistente>(asistentes);
        }
示例#35
0
        private void CargarDescuentosEmpleados()
        {
            try
            {
                var sorted = new SortableBindingList <BE.UI.DescuentoEmpleado>(this.lstUiDescuentosEmpleados);
                this.dgvDescuentos.DataSource = sorted;

                int nroDescuentos = this.lstUiDescuentosEmpleados.Count;
                this.txtNroDescuentos.Text = nroDescuentos.ToString();

                double totalDescuentos = this.lstUiDescuentosEmpleados.Sum(x => x.Monto);
                this.txtTotal.Text = totalDescuentos.ToString("N2");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#36
0
        internal void SetProjectDataSource(SortableBindingList <Project> sortableBindingList)
        {
            this.ProjectBindingSource.DataSource = sortableBindingList;

            projectDeployApplicationPanel.ProjectBindingSource.DataSource = this.ProjectBindingSource.DataSource;
            projectDeployApplicationPanel.TodoBindingSource.DataSource    = this.todoBindingSource.DataSource;
            projectDeployApplicationPanel.SprintBindingSourceDataSource   = this.sprintBindingSource.DataSource;
            reportPanel.ProjectBindingSource.DataSource = this.ProjectBindingSource.DataSource;
            reportPanel.TodoBindingSource.DataSource    = this.todoBindingSource.DataSource;
            reportPanel.SprintBindingSourceDataSource   = this.sprintBindingSource.DataSource;

            projectDetailsPanel.ProjectBindingSource.DataSource = this.ProjectBindingSource.DataSource;
            projectDevelopPanel.ProjectBindingSource.DataSource = this.ProjectBindingSource.DataSource;
            this.ProjectBindingSource.PositionChanged          += new EventHandler(BindingSource_PositionChanged);

            projectDetailsPanel.ProjectBindingSource.ResumeBinding();
            this.ProjectBindingSource.BindingComplete += new BindingCompleteEventHandler(BindingSource_BindingComplete);
        }
示例#37
0
        private void CargarListadoRecibos(int anho = 0, int mes = 0, string codigoEmpleado = "")
        {
            try
            {
                double totBase       = 0.0; //Sueldo
                double totBonos      = 0.0;
                double totDescuentos = 0.0;
                double totGeneral    = 0.0;

                List <BE.UI.Recibo> lstUiRecibosResumen = new List <BE.UI.Recibo>();

                if (anho > 0 || mes > 0 || codigoEmpleado.Length > 0)
                {
                    lstUiRecibosResumen = new LN.Recibo().ResumenDetallado(anho, mes, codigoEmpleado);

                    //totBase = lstUiRecibosResumen.Where(x => x.Tipo.Equals("Sueldo")).Sum(x => x.Monto);
                    totBonos      = lstUiRecibosResumen.Where(x => x.Tipo.Equals("Bono")).Sum(x => x.Total);
                    totDescuentos = lstUiRecibosResumen.Where(x => x.Tipo.Equals("Descuento")).Sum(x => x.Total);

                    if (this.txtTipo.Text == BE.UI.TipoTrabajadorEnum.Candidato.ToString())
                    {
                        var beCandidatoContratacion = new LN.Candidato().ObtenerContratacion(codigoEmpleado);
                        if (beCandidatoContratacion != null)
                        {
                            totBase = beCandidatoContratacion.Sueldo;
                        }
                    }

                    totGeneral = totBase + totBonos - totDescuentos;
                }

                var sorted = new SortableBindingList <BE.UI.Recibo>(lstUiRecibosResumen);
                this.dgvRecibos.DataSource = sorted;

                this.txtTotalSueldo.Text     = totBase.ToString("N2");
                this.txtTotalBonos.Text      = totBonos.ToString("N2");
                this.txtTotalDescuentos.Text = totDescuentos.ToString("N2");
                this.txtTotalGeneral.Text    = totGeneral.ToString("N2");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#38
0
        /// <summary>
        ///     Gets all.
        /// </summary>
        /// <returns></returns>
        public SortableBindingList <Item> GetAll()
        {
            var allItems = new SortableBindingList <Item>();

            var connStr = ConfigurationManager.ConnectionStrings[this.connectionString].ConnectionString;

            using (var conn = new MySqlConnection(connStr))
            {
                conn.Open();

                using (var cmd = new MySqlCommand("SELECT * from ITEM", conn))
                {
                    using (var dataReader = cmd.ExecuteReader())
                    {
                        while (dataReader.Read())
                        {
                            var currItem = new Item
                            {
                                ItemId =
                                    (Convert.IsDBNull(dataReader["itemID"])
                                        ? int.MinValue
                                        : (int)dataReader["itemID"]),
                                Name       = dataReader["name"] as string,
                                Type       = dataReader["type"] as string,
                                Style      = dataReader["style"] as string,
                                Pattern    = dataReader["pattern"] as string,
                                CostPerDay =
                                    (Convert.IsDBNull(dataReader["costPerDay"])
                                        ? double.MinValue
                                        : Math.Round((double)dataReader["costPerDay"], 2)),
                                LateFeePerDay =
                                    (Convert.IsDBNull(dataReader["lateFeePerDay"])
                                        ? double.MinValue
                                        : Math.Round((double)dataReader["lateFeePerDay"], 2))
                            };

                            allItems.Add(currItem);
                        }
                    }
                }
            }

            return(allItems);
        }
        private static SortableBindingList <VerifiedConditionItem> GetVerifiedConditionItems(
            [NotNull] IEnumerable <QualityConditionVerification> conditionVerifications,
            out int maximumIssueCount)
        {
            var result = new SortableBindingList <VerifiedConditionItem>();

            maximumIssueCount = 0;
            foreach (QualityConditionVerification verification in conditionVerifications)
            {
                if (verification.ErrorCount > maximumIssueCount)
                {
                    maximumIssueCount = verification.ErrorCount;
                }

                result.Add(new VerifiedConditionItem(verification));
            }

            return(result);
        }
        private void SortTest(string property, ListSortDirection direction)
        {
            var list = new List <ListElement> {
                3, 1, 4, 1, 5, 9
            };
            var sortedList = direction == ListSortDirection.Ascending
                ? new List <ListElement> {
                1, 1, 3, 4, 5, 9
            }
                : new List <ListElement> {
                9, 5, 4, 3, 1, 1
            };

            var bindingList = new SortableBindingList <ListElement>(list);

            ((IBindingList)bindingList).ApplySort(ListElement.Property(property), direction);

            Assert.True(list.SequenceEqual(sortedList, new ListElementComparer()));
        }
示例#41
0
        private void button1_Click(object sender, EventArgs e)
        {
            TextBoxTraceListener _textBoxListener = new TextBoxTraceListener(calendarGetEvents_Status);

            Trace.Listeners.Add(_textBoxListener);
            try
            {
                CalendarAPI cApi = new CalendarAPI("*****@*****.**", "kibitzer");
                SortableBindingList <IndianCalendarEvent> test = cApi.getEvents(calendarGetEvents_startDate.Value, calendarGetEvents_endDate.Value, calendarGetEvents_SearchTextbox.Text);
                this.dataGridView1.DataSource = test;
                SpreadSheetAPI ssa   = new SpreadSheetAPI("Pair Results City And Event Names", "*****@*****.**", "kibitzer");
                DataTable      table = ssa.getValuesFromSheet("Sheet1");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Trace.Listeners.Remove(_textBoxListener);
        }
示例#42
0
        private void frmRanking_Load(object sender, EventArgs e)
        {
            Ranking rk = new Ranking();

            rk.SairRanking();
            rk.InserirRanking();
            SortableBindingList <Ranking> _lst = new SortableBindingList <Ranking>();
            var lst = Ranking.TabelaPedido();

            foreach (var item in lst)
            {
                _lst.Add(item);
            }

            grdRanking.AutoGenerateColumns = false;
            grdRanking.DataSource          = null;
            grdRanking.DataSource          = _lst;
            grdRanking.Show();
        }
        /// <summary>
        ///     Gets all.
        /// </summary>
        /// <returns></returns>
        public SortableBindingList <Rental> GetAll()
        {
            var allRentals = new SortableBindingList <Rental>();

            var connStr = ConfigurationManager.ConnectionStrings[this.connectionString].ConnectionString;

            using (var conn = new MySqlConnection(connStr))
            {
                conn.Open();

                using (var cmd = new MySqlCommand("SELECT * from RENTAL", conn))
                {
                    using (var dataReader = cmd.ExecuteReader())
                    {
                        while (dataReader.Read())
                        {
                            var rentalId      = (Convert.IsDBNull(dataReader["rentalID"]) ? 0 : (int)dataReader["rentalID"]);
                            var transactionId = (Convert.IsDBNull(dataReader["transactionID"]) ? 0 : (int)dataReader["transactionID"]);
                            var itemId        = (Convert.IsDBNull(dataReader["itemID"])
                                ? 0
                                : (int)dataReader["itemID"]);

                            var currRental = new Rental
                            {
                                Quantity = (Convert.IsDBNull(dataReader["quantity"]) ? 0 : (int)dataReader["quantity"]),
                                DueDate  =
                                    (Convert.IsDBNull(dataReader["dueDate"])
                                        ? DateTime.MinValue
                                        : (DateTime)dataReader["dueDate"]),
                                RentalId      = rentalId.ToString(),
                                TransactionId = transactionId.ToString(),
                                ItemId        = itemId.ToString(),
                                IsReturned    = dataReader["isReturned"] as bool? ?? false
                            };

                            allRentals.Add(currRental);
                        }
                    }
                }
            }

            return(allRentals);
        }
示例#44
0
        public void GetFilteredMembersWithDifferentCaseTest()
        {
            var       allMembers   = new SortableBindingList <Member>();
            const int MemberNumber = 100;

            for (int i = 0; i < MemberNumber; i++)
            {
                allMembers.Add(new Member()
                {
                    Id = i, Nom = "Nom" + i, Prenom = "Prenom" + i
                });
            }

            _clubMock.Setup(_ => _.Members).Returns(allMembers);

            var filetedMembersWithNom50 = _easyJudoClubControler.GetFilteredMembersByName("nOm50");

            Assert.AreEqual(1, filetedMembersWithNom50.Count);
        }
示例#45
0
        void LoadAndValidateData(IList <T> data)
        {
            // Clear original data.
            Items.Clear();
            if (data == null)
            {
                data = new SortableBindingList <T>();
            }
            // Filter data if filter method exists.
            var fl    = ValidateData;
            var items = (fl == null)
                                ? data
                                : fl(data);

            for (int i = 0; i < items.Count; i++)
            {
                Items.Add(items[i]);
            }
        }
示例#46
0
        /// <summary>
        /// Gets history list for past six months and uses yesterday and yesterday - 6 months
        /// </summary>
        /// <param name="sender">Form object to use when binding</param>
        public async void GetPackageHistoryList(object sender = null)
        {
            DateTime dt1 = DateTime.Today.AddDays(-1);
            DateTime dt2 = DateTime.Today.AddMonths(-6);

            Sender = sender;
            string test1 = FormatDateString(dt1.ToString()), test2 = FormatDateString(dt2.ToString());
            SortableBindingList <Package> hist = await Task.Run(() => Get_Package_List(test2, test1));

            if (Sender is Reports t)
            {
                DataConnectionClass.DataLists.PackageHistory = hist;
                BindingSource bs = new BindingSource
                {
                    DataSource = DataConnectionClass.DataLists.PackageHistory
                };
                t.datGridHistory.DataSource = bs;
            }
        }
示例#47
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            _findEvent = new SortableBindingList <ExtendedEvent>(Event);
            dataGridView.DataSource = null;
            dataGridView.DataSource = _findEvent;
            dataGridView.Columns[4].DefaultCellStyle.Format = "MM.yyyy";

            if (Employee != null)
            {
                SearchTextBox.Text = Employee.ToString();
                OnSearchEvent(this, e);
            }
            else
            {
                SearchTextBox.Text = "";
            }
            Employee = null;
        }
示例#48
0
        void BindThreadsGridView(CodedPalette selectedPalette)
        {
            if (selectedPalette != currentPalette || selectedPalette == null)
            {
                SaveChangesInCurrentPalette();

                var oldDataSource = gridViewThreads.DataSource as BindingList <CodedColor>;
                if (oldDataSource != null)
                {
                    oldDataSource.AddingNew -= ThreadsDataSource_AddingNew;
                }

                try
                {
                    var editable = !selectedPalette?.IsSystem ?? false;
                    currentPalette = selectedPalette;
                    if (currentPalette != null)
                    {
                        var newDataSource = new SortableBindingList <CodedColor>(currentPalette.ToList <CodedColor>())
                        {
                            AllowNew               = editable,
                            AllowEdit              = editable,
                            AllowRemove            = editable,
                            RaiseListChangedEvents = editable
                        };
                        newDataSource.AddingNew += ThreadsDataSource_AddingNew;

                        gridViewThreads.DataSource = newDataSource;
                    }
                    else
                    {
                        gridViewThreads.DataSource = null;
                    }
                    gridViewThreads.ReadOnly      = !editable;
                    gridViewThreads.SelectionMode = gridViewThreads.ReadOnly ? DataGridViewSelectionMode.FullRowSelect : DataGridViewSelectionMode.RowHeaderSelect;
                }
                catch
                {
                    currentPalette             = null;
                    gridViewThreads.DataSource = null;
                }
            }
        }
示例#49
0
        /// <summary>
        /// Gets history list from specified start date to the specified end date
        /// </summary>
        /// <param name="startdate">Search start date as a string (Must be a valid date string)</param>
        /// <param name="enddate">Search end date as a string (Must be a valid date string)</param>
        /// <param name="sender">Form object to use when binding</param>
        public async void GetPackageHistoryList(string startdate, string enddate, object sender = null)
        {
            bool s1 = DateTime.TryParse(startdate, out DateTime dt1);
            bool s2 = DateTime.TryParse(enddate, out DateTime dt2);

            Sender = sender;
            string test1 = FormatDateString(dt1.ToString()), test2 = FormatDateString(dt2.ToString());
            SortableBindingList <Package> hist = await Task.Run(() => Get_Package_List(test2, test1));

            if (Sender is Reports t)
            {
                DataConnectionClass.DataLists.PackageHistory = hist;
                BindingSource bs = new BindingSource
                {
                    DataSource = DataConnectionClass.DataLists.PackageHistory
                };
                t.datGridHistory.DataSource = bs;
            }
        }
示例#50
0
        private string AllTime(ref SortableBindingList <MStunden> Value)
        {
            double result = 0.0f;

            foreach (MStunden std in Value)
            {
                string value = std.Arbeitszeit;
                value = value.Replace(",", ".");
                try
                {
                    result += double.Parse(value, System.Globalization.CultureInfo.InvariantCulture);
                }
                catch
                {
                    result += 0.0;
                }
            }
            return(result.ToString("0.00"));
        }
示例#51
0
        private void LoadData()
        {
            try
            {
                this.Cursor         = Cursors.WaitCursor;
                groupList           = vmMas.GetGroup(txtName.TextValue, chkShowDeleteRecord.Checked);
                gvResult.DataSource = groupList;

                gvResult.SetRowDeletedStyle((int)eCol.DEL_ID);
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        public async void GetAuditLog(object sender = null)
        {
            SortableBindingList <AuditItem> al = await Task.Run(() => Get_Audit_Log());

            if (sender is Manage)
            {
                Manage t = (Manage)sender;
                DataConnectionClass.DataLists.AuditLog = al;
                BindingSource bs = new BindingSource()
                {
                    DataSource = DataConnectionClass.DataLists.AuditLog
                };
                t.dataGridView1.DataSource = bs;
            }
            else
            {
                DataConnectionClass.DataLists.AuditLog = al;
            }
        }
示例#53
0
        /// <summary>
        /// Load data into DataGridView, in a real app we would had used a DataGridViewComboBox
        /// for the status but that is outside the scope of this code sample. If interested I
        /// have one here https://code.msdn.microsoft.com/DataGridView-ComboBox-with-b62fe359
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            var ops = new Operations();

            Statuses = ops.StatusList();
            statusComboBox.DataSource = Statuses;

            // Setup for sorting
            blCustomers = new SortableBindingList <TestTable>(ops.Read());

            // Bind to the BindingList
            bsItem.DataSource = blCustomers;

            dataGridView1.AutoGenerateColumns = false;
            // Set DataGridView DataSource
            dataGridView1.DataSource = bsItem;
            // Expand columns
            dataGridView1.ExpandColumns();
        }
示例#54
0
        private void LoadData()
        {
            try
            {
                this.Cursor         = Cursors.WaitCursor;
                subdivisionList     = vmMas.GetSubDivision(cboDivision.NullableIntValue, txtName.TextValue, chkShowDeleteRecord.Checked);
                gvResult.DataSource = subdivisionList;

                gvResult.SetRowDeletedStyle((int)eCol.DEL_ID);
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        public static SortableBindingList <IDisplayLostCousin> VerifyAncestors(IProgress <string> outputText)
        {
            SortableBindingList <IDisplayLostCousin> result = new SortableBindingList <IDisplayLostCousin>();

            if (Website is null)
            {
                Website = LoadWebsiteAncestors(outputText);
            }
            WebLinks = new List <Uri>();
            foreach (LostCousin lostCousin in Website)
            {
                result.Add(lostCousin as IDisplayLostCousin);
                if (!WebLinks.Contains(lostCousin.WebLink))
                {
                    WebLinks.Add(lostCousin.WebLink);
                }
            }
            return(result);
        }
示例#56
0
        private void PasteClipboard()
        {
            DataObject dObject = (DataObject)Clipboard.GetDataObject();

            if (dObject.GetDataPresent(DataFormats.Text))
            {
                string[] pastedRows = Regex.Split(dObject.GetData(DataFormats.Text).ToString().TrimEnd("\r\n".ToCharArray()), "\r\n");
                SortableBindingList <Data> contractList = new SortableBindingList <Data>();
                foreach (string pastedRow in pastedRows)
                {
                    string[] pastedRowCells = pastedRow.Split(new char[] { '\t' });

                    if (pastedRowCells.Length > 0)
                    {
                        contractList.Add(new Data {
                            Contract = pastedRowCells[0]
                        });                                                          //, Status = pastedRowCells[1]
                    }
                }

                //list of status
                SortableBindingList <Data> itemStatus = new SortableBindingList <Data>()
                {
                    new Data {
                        Contract = "1", Status = "Completed"
                    }, new Data {
                        Contract = "4", Status = "Closed"
                    }, new Data {
                        Contract = "2", Status = "Pre-close"
                    },
                    new Data {
                        Contract = "3", Status = "INVALID"
                    },
                };

                foreach (var i in itemStatus)
                {
                    var itemToChange = contractList.First(c => c.Contract == i.Contract).Status = i.Status;
                }

                LoadList(contractList);
            }
        }
        /// <summary>
        /// Compares all queues for a server with those assigned to activities to determine those not being used.
        /// </summary>
        /// <param name="server">The server.</param>
        /// <param name="queuesInUse">The queues in use.</param>
        /// <returns></returns>
        public SortableBindingList <RemotePrintQueue> GetQueuesNotInUse(FrameworkServer server, SortableBindingList <PrintQueueInUse> queuesInUse)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }

            SortableBindingList <RemotePrintQueue> queuesToDelete = new SortableBindingList <RemotePrintQueue>();

            foreach (var queue in _context.RemotePrintQueues.Where(n => n.PrintServerId == server.FrameworkServerId))
            {
                if (!queuesInUse.Any(x => x.QueueName == queue.Name))
                {
                    queuesToDelete.Add(queue);
                }
            }

            return(queuesToDelete);
        }
示例#58
0
        private void BindDgv()
        {
            PreprocessInfoQueryRequest request = new PreprocessInfoQueryRequest();

            request.preprocessCode = tbPackageCode.Text.Trim();
            request.partnerCode    = UserInfo.PartnerCode;
            request.PageIndex      = paginator.PageNo;
            request.PageSize       = paginator.PageSize;

            PreprocessInfoResponse response = client.Execute(request);

            if (!response.IsError)
            {
                if (response.result == null)
                {
                    this.dataGridView1.DataSource = null;
                    return;
                }
                int recordCount = response.pageUtil.totalRow;
                int totalPage;
                if (recordCount % paginator.PageSize == 0)
                {
                    totalPage = recordCount / paginator.PageSize;
                }
                else
                {
                    totalPage = recordCount / paginator.PageSize + 1;
                }
                preprocessInfoList = response.result;

                IPagedList <PreprocessInfo> pageList = new PagedList <PreprocessInfo>(response.result, recordCount, totalPage);
                sortList = new SortableBindingList <PreprocessInfo>(pageList.ContentList);
                this.dataGridView1.DataSource = sortList;
                pageSplit1.Description        = "共查询到" + pageList.RecordCount + "条记录";
                pageSplit1.PageCount          = pageList.PageCount;
                pageSplit1.PageNo             = paginator.PageNo;
                pageSplit1.DataBind();
            }
            else
            {
                this.dataGridView1.DataSource = null;
            }
        }
示例#59
0
        private void bgwTickets_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                allTickets = e.Result as SortableBindingList <Ticket>;
                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource          = allTickets;

                lblResults.Text = string.Format("{0} Tickets returned", allTickets.Count);
            }
            else
            {
                lblResults.Text = "Error refreshing. Please check server connection and try again.";
            }

            cmbTicketQuery.Enabled = true;
            searchLabel.Enabled    = true;
            searchTextBox.Enabled  = true;
        }
示例#60
0
 private Facts()
 {
     InitializeComponent();
     facts = new SortableBindingList <IDisplayFact>();
     facts.SortFinished         += new EventHandler(Grid_SortFinished);
     allFacts                    = false;
     CensusRefReport             = false;
     dgFacts.AutoGenerateColumns = false;
     ExtensionMethods.DoubleBuffered(dgFacts, true);
     reportFormHelper = new ReportFormHelper(this, Text, dgFacts, ResetTable, "Facts");
     italicFont       = new Font(dgFacts.DefaultCellStyle.Font, FontStyle.Italic);
     linkFont         = new Font(dgFacts.DefaultCellStyle.Font, FontStyle.Underline);
     dgFacts.Columns["IndividualID"].Visible    = true;
     dgFacts.Columns["CensusReference"].Visible = true; // originally false - trying true v5.0.0.3
     dgFacts.Columns["IgnoreFact"].Visible      = false;
     dgFacts.ReadOnly         = true;
     sep1.Visible             = false;
     btnShowHideFacts.Visible = false;
 }