示例#1
0
        private void gridViewEscandallo_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            EscandalloPintar            row = (EscandalloPintar)gridViewEscandallo.GetRow(e.RowHandle);
            RepuestosDeMovilesDbContext dbContextRepuestos = new RepuestosDeMovilesDbContext();
            List <L_ENVIOS>             l_envios           = dbContextRepuestos.L_ENVIOS.Where(w => w.ARTICULO == row.codigo).OrderByDescending(o => o.CABECERA).ToList();

            gridControlEnvios.DataSource = l_envios;
        }
示例#2
0
        private void pintarEnvios()
        {
            ApplicationDbContextSql     dbcontext          = new ApplicationDbContextSql();
            RepuestosDeMovilesDbContext dbcontextRepuestos = new RepuestosDeMovilesDbContext();
            int currentRowHandle = gridViewArticulos.FocusedRowHandle;

            MyEntityModel.Articulo articulo = (MyEntityModel.Articulo)gridViewArticulos.GetRow(currentRowHandle);
            if (articulo != null)
            {
                gridControlEnvios.Invoke((MethodInvoker)(() => gridControlEnvios.DataSource = dbcontextRepuestos.L_ENVIOS.Where(w => w.ARTICULO == articulo.Codigo.Trim()).OrderByDescending(o => o.FECHA).ToList()));
//                gridControlEnvios.DataSource = dbcontextRepuestos.L_ENVIOS.Where(w => w.ARTICULO == articulo.Codigo.Trim()).OrderByDescending(o => o.FECHA).ToList();
            }
            else
            {
                gridControlEnvios.Invoke((MethodInvoker)(() => gridControlEnvios.DataSource = null));
//                gridControlEnvios.DataSource = null;
            }
        }
示例#3
0
        private void buttonEditAnadirCompetencia_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            ItemType item = MyEntityModel.FuncionesEbay.LeerArticuloEbay(buttonEditAnadirCompetencia.Text, "");

            if (item == null)
            {
                XtraMessageBox.Show("Número de artículo incorrecto", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            RepuestosDeMovilesDbContext dbContext = new RepuestosDeMovilesDbContext();
            int cuantos = dbContext.EBAY_SEGUIMIENTO.Where(w => w.ARTICULO == buttonEditAnadirCompetencia.Text.Trim() && w.CODIGO == codigoActual).Count();

            if (cuantos > 0)
            {
                XtraMessageBox.Show("Este artículo ya existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            MyEntityModel.FuncionesEbay.fnAnadirCompetenciaSeguimiento(item, codigoActual);
        }