Ejemplo n.º 1
0
        public void GoNext()
        {
            if (_items.Any(i => i.HasChanges))
            {
                var prog = new ProgressStep <ExportProcessor>(_wizard.ExportProcessor);
                prog.MethodInvoke = e => {
                    _wizard.InstallScript.Lines = (from i in _items
                                                   where !i.HasChanges
                                                   select i.Item).ToList();
                    e.Export(_wizard.InstallScript,
                             e.NormalizeRequest(from i in _items
                                                where i.HasChanges
                                                select i.Item.Reference));
                };
                prog.GoNextAction = () => _wizard.GoToStep(new ExportResolve());
                _wizard.GoToStep(prog);
            }
            else
            {
                if (_changes)
                {
                    _wizard.InstallScript.Lines = _items.Select(i => i.Item).ToList();
                }

                _wizard.GoToStep(new ExportOptions());
            }
        }
Ejemplo n.º 2
0
 private void SortIntervals()
 {
     if (!_intervals.Any())
     {
         return;
     }
 }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (!ListDataGridViewSource.Any(s => s.UserName == comboBox1.Text))
         {
             var pu = new ProjectUserDto
             {
                 ProjectId = ManagerProject.ProjectId,
                 Type      = comboBox2.Text,
                 UserName  = comboBox1.Text,
                 UserId    = ListCombobox1Source.Where(s => s.UserName == comboBox1.Text).Select(s => s.Id).FirstOrDefault()
             };
             ListDataGridViewSource.Add(pu);
             foreach (var a in ListCombobox1Source.ToList())
             {
                 if (a.Id == pu.UserId)
                 {
                     ListCombobox1Source.Remove(a);
                     break;
                 }
             }
             LoadData();
             loadcombobox();
         }
         else
         {
             MessageBox.Show($"Nhân viên {comboBox1.Text} đã có trong dự án");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show($"{ex}");
     }
 }
 /// <summary>
 /// Suppression d'une requête
 /// </summary>
 /// <param name="id">id de la requête à supprimer</param>
 public void Delete(int id)
 {
     if (_requests.Any(a => a.Id == id))
     {
         _requests.RemoveAt(_requests.IndexOf(_requests.First(a => a.Id == id)));
     }
 }
Ejemplo n.º 5
0
        void запуск_очередного()
        {
            if (binList.Any(n => n.забег))
            {
                результаты rRow = binList.Where(n => n.забег).OrderBy(n => n.порядок).First();
                rRow.старт  = DateTime.Now;
                rRow.финиш  = rRow.старт;
                rRow.плывут = true;
                rRow.забег  = false;

                panel2.Visible = true;
                WMPLib.WindowsMediaPlayer wmp = new WMPLib.WindowsMediaPlayer();
                wmp.URL = "СтартМ.wav";
                wmp.controls.play();

                if (!binList.Any(n => n.забег))
                {
                    timer1.Stop();
                    checkBox1.Checked = false;
                    MessageBox.Show("Старт окончен...");
                }
            }
            else
            {
                MessageBox.Show("Отметьте участников..");
            }
        }
Ejemplo n.º 6
0
 private void UpdatePlayerList(object sender, PlayerListEventArgs e)
 {
     if (e.Operation == Operations.Add)
     {
         if (!PlayerList.Any(a => a.Id == e.Id))
         {
             PlayerList.Add(e);
         }
     }
     else if (e.Operation == Operations.Remove)
     {
         if (PlayerList.Any(a => a.Id == e.Id))
         {
             PlayerList.Remove(PlayerList.Where(a => a.Id == e.Id).First());
         }
     }
     else if (e.Operation == Operations.Update)
     {
         if (PlayerList.Any(a => a.Id == e.Id))
         {
             PlayerListEventArgs currentValue = PlayerList.Where(a => a.Id == e.Id).First();
             currentValue = e;
             PlayerList.ResetBindings();
         }
     }
 }
Ejemplo n.º 7
0
 private void TaskCompleted(SharpEncryptTaskModel task)
 {
     ActiveTasks.Remove(task);
     ActiveTasksGridView.Refresh();
     if (!ActiveTasks.Any())
     {
         AllTasksCompleted?.Invoke();
     }
 }
Ejemplo n.º 8
0
        public Boolean MyContains(string a)
        {
            bool value = false;

            if (_list.Any(l => l.Account.ToLower().Trim().Equals(a.ToLower().Trim())))
            {
                value = true;
            }
            return(value);
        }
Ejemplo n.º 9
0
        private void SiteSelection_Load(object sender, EventArgs e)
        {
            this.comboBox1.DataSource = manifests;
            RefreshVariables();

            if (manifests.Any())
            {
                this.selectManifest(0);
            }
        }
        private void UpdateCharacterDependent()
        {
            nextTurnButton.Enabled  = m_Characters.Any();
            newCombatButton.Enabled = m_Characters.Any();

            interrupt5Button.Enabled  = SelectedCharacter != null && SelectedCharacter.Initiative >= 5;
            interrupt10Button.Enabled = SelectedCharacter != null && SelectedCharacter.Initiative >= 10;

            delayButton.Enabled = m_CurrentCharacter == SelectedCharacter;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// This is used to see if the framework contains an assembly that uses the specified name
        /// </summary>
        /// <param name="assemblyName">The assembly name without a path or extension or a strong name value.
        /// If a strong name value is specified, a "starts with" comparison on the description is used to see if
        /// the assembly is present in the framework.  This allows for matches on strong names with processor
        /// architecture specified which we don't have.  If only a name is given, just the name is compared.
        /// Comparisons are case-insensitive.</param>
        /// <returns>True if the framework contains the named assembly, false if not.</returns>
        public bool ContainsAssembly(string assemblyName)
        {
            if (assemblyName.IndexOf(',') != -1)
            {
                return(assemblyLocations.Any(al => al.IncludedAssemblies.Any(a => assemblyName.StartsWith(
                                                                                 a.Description, StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename))));
            }

            return(assemblyLocations.Any(al => al.IncludedAssemblies.Any(a => assemblyName.Equals(a.Name,
                                                                                                  StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename))));
        }
Ejemplo n.º 12
0
        private void RunSelectedTestMenuItemClicked(object sender, EventArgs e)
        {
            var handler = OnRunSelectedTestButtonClick;

            if (handler != null && _allTests.Any())
            {
                var selection = _allTests.Where(test => testOutputGridView.SelectedRows
                                                .Cast <DataGridViewRow>()
                                                .Select(row => row.DataBoundItem as TestExplorerItem)
                                                .Select(item => item.GetTestMethod())
                                                .Contains(test.GetTestMethod()));

                handler(this, new SelectedTestEventArgs(selection));
            }
        }
Ejemplo n.º 13
0
        private void fieldsTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            ReportField field = e.Node.Tag as ReportField;

            if (field == null)
            {
                return;
            }
            if (fieldsVM.Any(fv => fv.Name == field.Name))
            {
                MessageBox.Show("Поле уже добавлено", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            fieldsVM.Add(new FieldViewModel(field));
        }
Ejemplo n.º 14
0
        private void buttonAceptarLibreria_Click(object sender, EventArgs e)
        {
            bool libreriaRepetida  = listaLibreriasAñadir.Any(p => p.nombre.Equals(textBoxNombreLibreria.Text));
            bool direccionRepetida = listaLibreriasAñadir.Any(p => p.direccion.Equals(textBoxDireccion.Text));

            if (libreriaRepetida == true)
            {
                MessageBox.Show("Este nombre de libreria ya existe en otra libreria, introduce uno nuevo.",
                                "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (direccionRepetida == true)
            {
                MessageBox.Show("Esta dirección de libreria ya existe en otra libreria, introduce una nueva.",
                                "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (textBoxNombreLibreria.Text.Equals(""))
            {
                MessageBox.Show("Es obligatorio rellanar el campo Nombre.",
                                "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBoxNombreLibreria.Focus();
            }
            else if (textBoxDireccion.Text.Equals(""))
            {
                MessageBox.Show("Es obligatorio rellanar el campo Dirección.",
                                "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBoxDireccion.Focus();
            }
            else if (textBoxTelefono.Text.Equals(""))
            {
                MessageBox.Show("Es obligatorio rellanar el campo Telefono.",
                                "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBoxTelefono.Focus();
            }
            else if (textBoxHorario.Text.Equals(""))
            {
                MessageBox.Show("Es obligatorio rellanar el campo Horario.",
                                "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBoxTelefono.Focus();
            }
            else
            {
                libreria = new Libreria(listaLibreriasAñadir, textBoxNombreLibreria.Text, textBoxDireccion.Text, textBoxHorario.Text, textBoxTelefono.Text);

                listaLibreriasAñadir.Add(libreria);

                this.Close();
            }
        }
Ejemplo n.º 15
0
            /// <summary>
            /// the magic happens here ;-)
            /// </summary>
            /// <param name="e"></param>
            protected override void OnTextChanged(EventArgs e)
            {
                base.OnTextChanged(e);

                if (!Focused)
                {
                    return;
                }

                _suggBindingList.Clear();
                _suggBindingList.RaiseListChangedEvents = false;
                _propertySelectorCompiled(Items)
                .Where(_filterRuleCompiled)
                .OrderBy(_suggestListOrderRuleCompiled)
                .ToList()
                .ForEach(_suggBindingList.Add);
                _suggBindingList.RaiseListChangedEvents = true;
                _suggBindingList.ResetBindings();

                _suggLb.Visible = _suggBindingList.Any();

                if (_suggBindingList.Count == 1 &&
                    _suggBindingList.Single().Length == Text.Trim().Length)
                {
                    Text = _suggBindingList.Single();
                    Select(0, Text.Length);
                    _suggLb.Visible = false;
                }
            }
Ejemplo n.º 16
0
        public WorldHandler()
        {
            m_DownloadDir = Program.GetUserDataPath();

            m_ConfigFile  = new WorldConfigFile(Path.Combine(m_DownloadDir, "worldConfig.xml"));
            m_PlayerFile  = new PlayerFile(Path.Combine(m_DownloadDir, "player.txt"));
            m_VillageFile = new VillageFile(Path.Combine(m_DownloadDir, "village.txt"));

            Servers = new BindingList <Server>(Program.Config.Servers);

            if (!Servers.Any())
            {
                Servers.Add(new Server("de", "https://www.die-staemme.de"));
                Servers.Add(new Server("ch", "https://www.staemme.ch"));
                Servers.Add(new Server("en", "https://www.tribalwars.net"));
                Servers.Add(new Server("nl", "https://www.tribalwars.nl/"));
                Servers.Add(new Server("pl", "https://www.plemiona.pl/"));
                Servers.Add(new Server("se", "https://www.tribalwars.se/"));
                Servers.Add(new Server("br", "https://www.tribalwars.com.br/"));
                Servers.Add(new Server("pt", "https://www.tribalwars.com.pt/"));
                Servers.Add(new Server("cz", "https://www.divokekmeny.cz/"));
                Servers.Add(new Server("jap", "https://www.bujokjeonjaeng.org/"));
                Servers.Add(new Server("ro", "https://www.triburile.ro/"));
                Program.Config.SaveConfig();
            }


            m_Wolrds.Add(new WorldInfo("Welt wählen", "", 1, 1));
            //DownloadServerInfo(); // Fill the WorldInfo

            ParseFiles();
        }
Ejemplo n.º 17
0
        private void RunServer()
        {
            serverCertificate = X509Certificate.CreateFromCertFile(certPath);

            Listener = new TcpListener(IPAddress.Any, Settings.Default.ServerPort);
            Listener.Start();

            while (ServerRuning == true)
            {
                try
                {
                    var client = new NetClient(Listener.AcceptTcpClient(), this);
                    lock (Clients)
                    {
                        if (Clients.Any(c => c.ClientIP == client.ClientIP) == false)
                        {
                            client.Discunnected    += new LossConnectionHandler(client_Discunnected);
                            client.LossConnection  += new LossConnectionHandler(client_LossConnection);
                            client.ExeptionOccured += new ExeptionOccuredHandler(client_ExeptionOccured);

                            Clients.Add(client);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.WriteError(MethodInfo.GetCurrentMethod(), ex);
                }
            }
        }
        /// <summary>
        /// the magic happens here ;-)
        /// </summary>
        /// <param name="e"></param>
        private void ComboBox_TextChanged(object sender, EventArgs e)
        {
            if (!comboBox.Focused)
            {
                return;
            }

            _suggBindingList.Clear();
            _suggBindingList.RaiseListChangedEvents = false;
            _propertySelectorCompiled(comboBox.Items)
            .Where(_filterRuleCompiled)
            //.OrderBy(_suggestListOrderRuleCompiled)
            .ToList()
            .ForEach(_suggBindingList.Add);
            _suggBindingList.RaiseListChangedEvents = true;
            _suggBindingList.ResetBindings();

            _suggLb.Visible = _suggBindingList.Any();

            if (_suggBindingList.Count == 1 &&
                _suggBindingList.Single().Length == comboBox.Text.Trim().Length)
            {
                comboBox.Text = _suggBindingList.Single();
                comboBox.Select(0, comboBox.Text.Length);
                _suggLb.Visible = false;
            }
        }
 private void grd_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
 {
     try
     {
         var f = new frmLineaSelector();
         f.ShowDialog();
         var linea = f.LineaSeleccionada;
         if (linea == null)
         {
             return;
         }
         if (!_gridDataSouce.Any(p => p.v_IdUnidadProductiva != null && p.v_IdUnidadProductiva.Equals(linea.IdLinea)))
         {
             var fila = grd.ActiveRow;
             var item = (planDto)fila.ListObject;
             fila.Cells["v_IdUnidadProductiva"].SetValue(linea.IdLinea, false);
             fila.Cells["NombreLinea"].SetValue(linea.Nombre, false);
             fila.Cells["v_OrganizationSeguroId"].SetValue(_aseguradoraId, false);
             fila.Cells["v_ProtocoloId"].SetValue(_protocolId, false);
             item.Editado = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 20
0
        public void execute(BindingList <NameMacro> tableNMacro, BindingList <Variable> tableV, BindingList <BodyMacro> tableMacro, BindingList <Instruction> tom)
        {
            if (Config.getInstance().macroMode)
            {
                tableMacro.Add(new BodyMacro()
                {
                    Number = tableMacro.Count(),
                    Body   = $"{data.lable?.ToString()} {data.directive.ToString()} {(data.args!=null ? data.args.get(0)?.ToString() : "")} {(data.args != null ? data.args.get(1)?.ToString() : "")}",
                });
                return;
            }

            string varValue = null;

            if (tableV.Any(i => i.Name == Utils.GetUniquePrefix(data.args.get(0))))
            {
                string arg = data.args.get(0);
                varValue = int.Parse(tableV.First(i => i.Name == Utils.GetUniquePrefix(arg)).Value).ToString();
            }
            if (Utils.ConvertTo16(varValue) == -1)
            {
                throw new ArgumentException("Неправильно указан размер");
            }

            tom.Add(new Instruction()
            {
                Name         = data.lable,
                SymbolicName = data.directive,
                Length       = data.args?.get(0),
                Code         = data.args?.get(1),
            });
        }
Ejemplo n.º 21
0
        private void InsertToTheRightPlace(ViewModel currentfile)
        {
            Labels.CurrentStatus = Status.Processing;
            FaceFormToolStripStatusLabel.Text = $"{currentfile.File} {Utilities.GetValueOfSetting(FaceFormToolStripStatusLabel.Name)}";
            if (!_viewModels.Any())
            {
                _viewModels.Add(currentfile);
                return;
            }

            if (_viewModels.Select(v => v.File).ToArray().Contains(currentfile.File))
            {
                return;
            }

            foreach (var v in _viewModels)
            {
                if (int.Parse(currentfile.File) <= int.Parse(v.File))
                {
                    _viewModels.Insert(_viewModels.IndexOf(v), currentfile);
                    break;
                }

                if (v == _viewModels.Last())
                {
                    _viewModels.Add(currentfile);
                    break;
                }
            }
        }
Ejemplo n.º 22
0
        protected void BtnEditRemoveFlagClick(object sender, EventArgs e)
        {
            var flagThis = new FlagWindow {
                FlagComment = _selectedKey.Comment, CancelButtonText = "Remove"
            };

            if (flagThis.ShowDialog(this) == DialogResult.Abort)
            {
                FileHandler.RemoveFlag(_selectedFile.Name, _selectedKey.Name, flagThis.FlagComment);
                if (chbShowFlaggedOnly.Checked)
                {
                    var itemToRemove = _keysListSource.FirstOrDefault(k => k.File == _selectedFile.Name && k.Name == _selectedKey.Name);
                    _keysListSource.Remove(itemToRemove);
                    FileHandler.StringsCurrentDataSource[_selectedFile.Name].Remove(_selectedKey.Name);
                    if (!_keysListSource.Any())
                    {
                        FileHandler.StringsCurrentDataSource.Remove(_selectedFile.Name);
                        _filesListSource.Remove(_selectedFile);
                    }
                }
            }
            else
            {
                FileHandler.UpdateFlag(_selectedFile.Name, _selectedKey.Name, flagThis.FlagComment);
            }
            RefreshKeysListSelectedItem();
            UpdateFlagsUI();
        }
Ejemplo n.º 23
0
        private void AddFilesOrFolderToSources(string[] filesOrFolders)
        {
            if (projectListDataGridView.Rows.Count == source.Count)
            {
                source.RemoveAt(source.Count - 1);
            }

            projectListDataGridView.Refresh();
            var filepaths = new List <string>();

            foreach (string fileOrFolder in filesOrFolders)
            {
                if (Directory.Exists(fileOrFolder))
                {
                    filepaths.AddRange(Directory.GetFiles(fileOrFolder, "*.??proj", SearchOption.AllDirectories));
                    SourceProjectFolderTextBox.Text = fileOrFolder; // last one wins. May or may not be useful.
                }
                else if (fileOrFolder.IsaCsOrVbProjFile())
                {
                    filepaths.Add(fileOrFolder);
                }
            }
            foreach (string filePath in filepaths)
            {
                if (!projectsList.Any(p => p?.SourceProject == filePath))
                {
                    projectsList.Add(new ProjectToLink
                    {
                        SourceProject          = filePath,
                        DestinationProjectName = Path.GetFileName(filePath)
                    });
                }
            }
            CheckProjectsList();
        }
Ejemplo n.º 24
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            string urunAd    = txtUrunAd.Text.Trim();
            bool   urunVarMi = blUrunler.Any(x => x.UrunAd.ToLower() == urunAd.ToLower());

            if (txtUrunAd.Text != string.Empty && nudFiyat.Value > -1 && nudStokAdet.Value >= 0 && urunVarMi == false)
            {
                urun = new Urun
                {
                    UrunAd        = urunAd,
                    BirimFiyat    = nudFiyat.Value,
                    StokAdedi     = (int)nudStokAdet.Value,
                    DegisimZamani = DateTime.Now
                };
                blUrunler.Add(urun);
            }
            else if (urunVarMi)
            {
                MessageBox.Show("Var olan ürün girdiniz.");
            }
            else
            {
                MessageBox.Show("Eksik veya hatalı bilgi girdiniz.");
            }
            dgvUrunler.DataSource = blUrunler;
        }
Ejemplo n.º 25
0
        public bool llenarListaLicencia()
        {
            bool flag  = false;
            int  filas = tablaLicencias.Rows.Count;

            for (int i = 0; i < filas; i++)
            {
                if (((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 0))).Value != null)
                {
                    if (Convert.ToBoolean(((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 0))).Value.ToString()) == true)
                    {
                        licencia            = new Licencia();
                        licencia.IdLicencia = int.Parse(((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 6))).Value.ToString());
                        licencia.Categoria  = ((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 1))).Value.ToString();
                        licencia.Marca      = ((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 3))).Value.ToString();
                        licencia.Version    = ((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 4))).Value.ToString();
                        licencia.Clave      = ((GridCell)(dgvLicencia.PrimaryGrid.GetCell(i, 5))).Value.ToString();
                        bool exists = licencias.Any(x => x.Categoria.Equals(licencia.Categoria));
                        if (!(exists))
                        {
                            licencias.Add(licencia);
                            flag = true;
                        }
                    }
                }
            }
            return(flag);
        }
Ejemplo n.º 26
0
 private void buttonModificarLibreria_Click(object sender, EventArgs e)
 {
     //Comprovamos que esta libreria no este ya en la lista de librerias
     libreriaRepetida = listaLibreriasAjustes.Any(p => p.nombre.Equals(this.textBoxNombreLibreria.Text) && p.id != libreria.id);
     if (libreriaRepetida == true)
     {
         MessageBox.Show("El nombre de esta libreria ya existe, introduce uno nuevo.", "ERROR",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (this.textBoxDireccion.Text.Equals("") || this.textBoxHorario.Text.Equals("") ||
              this.textBoxTelefono.Text.Equals(""))
     {
         MessageBox.Show("Introduce todos los datos.", "ATENCIÓN",
                         MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         //Editamos la libreria con la info insertada
         libreria.nombre         = textBoxNombreLibreria.Text;
         libreria.direccion      = textBoxDireccion.Text;
         libreria.numeroTelefono = textBoxTelefono.Text;
         libreria.horario        = textBoxHorario.Text;
         foreach (Actividad act in libreria.listaActividades)
         {
             act.direccion = libreria.direccion;
         }
         this.Close();
     }
 }
 private void grvDanhSach_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     if (!lstEdited.Any(x => x.KeyID == ((eNhomKhachHang)e.Row).KeyID))
     {
         lstEdited.Add((eNhomKhachHang)e.Row);
     }
 }
Ejemplo n.º 28
0
        private void btnAgregarProducto_Click(object sender, EventArgs e)
        {
            if (cmbCliente.SelectedValue == null)
            {
                MessageBox.Show("No se puede agregar productos\n si no se ha seleccionado un cliente correcto.", "◄ AVISO | LEASEIN ►", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            using (frmProcesoCorteAlquilerAgregarProducto frm = new frmProcesoCorteAlquilerAgregarProducto(IdCliente))
            {
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    BindingList <CorteAlquiler> auxiliares = new BindingList <CorteAlquiler>();
                    foreach (CorteAlquiler aux in renovaciones)
                    {
                        auxiliares.Add(aux);
                    }

                    foreach (CorteAlquiler detalleTraido in frm.DETALLES)
                    {
                        CorteAlquiler dp = new CorteAlquiler();
                        dp.IdLC = detalleTraido.IdLC;
                        bool exists = auxiliares.Any(x => x.IdLC.Equals(dp.IdLC));
                        if (!(exists))
                        {
                            auxiliares.Add(detalleTraido);
                        }
                    }
                    renovaciones = auxiliares;
                }
            }

            dgvEquiposSeleccionados.DataSource = renovaciones;
        }
Ejemplo n.º 29
0
        private void ProcessScannedEntry(string productID)
        {
            Item item = this.FindItem(productID);

            if (item == null)
            {
                this.ShowNoFoundMsg(productID);
            }
            else
            {
                List <string> locations = item.BinLocation.Split(new Char[1] {
                    ' '
                }).ToList();
                locations.Add(_scanBin);
                string updatedBin = String.Join(" ", locations.Distinct()).Trim();
                if (updatedBin.Length <= 20)
                {
                    if (!_scanProducts.Any(p => p.ID.Equals(item.ItemLookupCode)))
                    {
                        _scanProducts.Add(new ProductStock(item, _scanBin));
                    }
                    else
                    {
                        _scanProducts.Single(p => p.ID.Equals(item.ItemLookupCode)).QtyScan++;
                    }
                }
                else
                {
                    this.ShowFullBinMsg(item.BinLocation);
                }
            }
        }
Ejemplo n.º 30
0
        public void SetDataSource(BindingList <string> datasource)
        {
            this.StringBindingList = new BindingList <StringObject>();
            this.origDataSource    = datasource;

            var items = from s in datasource orderby s select s;

            foreach (var s in items)
            {
                if (!StringBindingList.Any(item => item.Text == s))
                {
                    StringBindingList.Add(new StringObject {
                        Text = s
                    });
                }
            }

            this.SetDataSourceList();

            gridControl.DataSource = StringBindingList;
            gridControl.Enabled    = true;

            StringBindingList.AddingNew   += this.StringBindingList_AddingNew;
            StringBindingList.ListChanged += this.StringBindingList_ListChanged;
        }
Ejemplo n.º 31
0
    private void add(BindingList<BondSpreadLine> list_, CountryBondSource src1_, CountryBondSource src2_, bool firstFirst_)
    {
      Array.ForEach(src1_.Lines.ToArray(), benchBond =>
      {
        var closestBond =
          src2_.Lines.Select(x => new { Diff = Math.Abs((benchBond.Maturity - x.Maturity).TotalDays), Item = x })
            .OrderBy(x => x.Diff)
            .First();

        if (closestBond.Diff > DaysDiffTolerance) return;

        var line = firstFirst_ ? new BondSpreadLine(benchBond, closestBond.Item) : new BondSpreadLine(closestBond.Item, benchBond);

        if (
          list_.Any(
            x => object.ReferenceEquals(x.Lines[0], line.Lines[0]) && object.ReferenceEquals(x.Lines[1], line.Lines[1])))
          line.Dispose();
        else
          list_.Add(line);
      });
    }
Ejemplo n.º 32
0
        public void SetDataSource(BindingList<string> datasource)
        {
            this.StringBindingList = new BindingList<StringObject>();
            this.origDataSource = datasource;

            var items = from s in datasource orderby s select s;

            foreach (var s in items)
            {
                if (!StringBindingList.Any(item => item.Text == s))
                {
                    StringBindingList.Add(new StringObject { Text = s });
                }
            }

            this.SetDataSourceList();

            gridControl.DataSource = StringBindingList;
            gridControl.Enabled = true;

            StringBindingList.AddingNew += this.StringBindingList_AddingNew;
            StringBindingList.ListChanged += this.StringBindingList_ListChanged;
        }
Ejemplo n.º 33
0
 private void UpdateItemOnGrid(BindingList<MarketViewItem> marketViewItems, MarketViewItem marketItem)
 {
     if (marketViewItems.Any(m => m.Instrument == marketItem.Instrument))
     {
         for (int i = 0; i < marketViewItems.Count; i++)
         {
             if (marketViewItems[i].Instrument == marketItem.Instrument)
             {
                 marketViewItems[i] = marketItem;
             }
         }
     }
     else
     {
         marketViewItems.Add(marketItem);
     }
 }
Ejemplo n.º 34
0
        public void DeleteConcreteEntities(BindingList<TestForGrid> testGrids, BindingList<SpecimenForGrid> specimenGrids, BindingList<TubeForGrid> tubeGrids, BindingList<IndicationForGrid> indicationGrids, string orderNumber)
        {
            var oldConcreteTests = OrderService.FindConcreteTestsByOrder(orderNumber);
            foreach (var oldConcreteTest in oldConcreteTests)
            {
                if (!testGrids.Any(testGrid => testGrid.ConcreteCode == oldConcreteTest.Code))
                {
                    OrderService.DeleteConcreteTest(oldConcreteTest.Code);
                }
            }

            var oldConcreteSpecimens = OrderService.FindConcreteSpecimensByOrder(orderNumber);
            foreach (var oldConcreteSpecimen in oldConcreteSpecimens)
            {
                if (specimenGrids.SingleOrDefault<SpecimenForGrid>(specimenGrid => specimenGrid.ConcreteCode == oldConcreteSpecimen.Code) == null)
                {
                    OrderService.DeleteConcreteSpecimen(oldConcreteSpecimen.Code);
                }
            }

            var oldConcreteTubes = OrderService.FindConcreteTubesByOrder(orderNumber);
            foreach (var oldConcreteTube in oldConcreteTubes)
            {
                if (tubeGrids.SingleOrDefault<TubeForGrid>(tubeGrid => tubeGrid.ConcreteCode == oldConcreteTube.Code) == null)
                {
                    OrderService.DeleteConcreteTube(oldConcreteTube.Code);
                }
            }

            var oldConcreteIndications = OrderService.FindConcreteIndicationsByOrder(orderNumber);
            foreach (var oldConcreteIndication in oldConcreteIndications)
            {
                if (indicationGrids.SingleOrDefault<IndicationForGrid>(indicationGrid => indicationGrid.ConcreteCode == oldConcreteIndication.Code) == null)
                {
                    OrderService.DeleteConcreteIndication(oldConcreteIndication.Code);
                }
            }
        }