Beispiel #1
0
        private void ValoresPorDefecto()
        {
            iNumeroitem.EditValue = VwCpventadetMnt.Numeroitem;
            iIdalmacen.EditValue  = CpVentaItemParameter.IdAlmacenConsulta;

            if (VwCpventadetList.Count(x => x.DataEntityState != DataEntityState.Deleted) == 0)
            {
                iIdcentrodecosto.EditValue = CpVentaItemParameter.IdCentroBeneficio;
                iIdproyecto.EditValue      = CpVentaItemParameter.IdProyectoCliente;
                iIdarea.EditValue          = CpVentaItemParameter.IdAreaEmpleado;
            }
            else
            {
                VwCpventadet vwCpventadetUltimo = VwCpventadetList.LastOrDefault(x => x.DataEntityState != DataEntityState.Deleted);
                if (vwCpventadetUltimo != null)
                {
                    iIdcentrodecosto.EditValue = vwCpventadetUltimo.Idcentrodecosto;
                    iIdproyecto.EditValue      = vwCpventadetUltimo.Idproyecto;
                    iIdarea.EditValue          = vwCpventadetUltimo.Idarea;
                }
            }

            Almacen almacen = AlmacenList.FirstOrDefault(x => x.Idalmacen == (int)iIdalmacen.EditValue);

            if (almacen != null)
            {
                iIdubicacion.EditValue = almacen.Idubicaciondefecto;
            }
        }
        protected new SortedBindingList <AlmacenInfo> Localize(object value, string column_name)
        {
            SortedBindingList <AlmacenInfo> list = null;
            AlmacenList sourceList = null;

            switch (FilterType)
            {
            case IFilterType.None:
                if (List == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = List;
                break;

            case IFilterType.Filter:
                if (FilteredList == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = FilteredList;
                break;
            }

            FCriteria criteria = null;

            string related = "none";

            switch (column_name)
            {
            default:
                criteria = GetCriteria(column_name, value, _operation);
                break;
            }

            switch (related)
            {
            case "none":
                list = sourceList.GetSortedSubList(criteria);
                break;
            }

            if (list.Count == 0)
            {
                MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                return(sourceList.GetSortedList());
            }

            DatosSearch.DataSource = list;
            DatosSearch.MoveFirst();

            AddFilterItem(column_name, value);

            return(list);
        }
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    AlmacenList listA = AlmacenList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    AlmacenList listD = AlmacenList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
Beispiel #4
0
    protected void ProductosList_SelectedIndexChanged(object sender, EventArgs e)
    {
        int productoId = Convert.ToInt32(ProductosList.SelectedValue);

        if (productoId <= 0)
        {
            PrecioTextBox.Text = "0";
            return;
        }

        Producto obj = ProductoBLL.GetProductoById(productoId);

        PrecioTextBox.Text = obj.PrecioCompra.ToString();
        ProductoIdHD.Value = productoId.ToString();
        AlmacenList.DataBind();
    }
        protected override void RefreshMainData()
        {
            Bar.Grow(string.Empty, "Almacenes");

            _selected_oid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = AlmacenList.GetList(false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            Bar.Grow(string.Empty, "Lista de Almacenes");
        }
        private IEnumerable <AlmacenItemViewModel> ToAlmacenItemViewModel()
        {
            return(AlmacenList.Select(m => new AlmacenItemViewModel
            {
                idAlmacen = m.idAlmacen,
                nombre = m.nombre,
                direccion = m.direccion,
                principal = m.principal,
                estado = m.estado,
                idSucursal = m.idSucursal,
                idUbicacionGeografica = m.idUbicacionGeografica,
                nombreSucursal = m.nombreSucursal,
                tieneRegistros = m.tieneRegistros,
                idPersonalAlmacen = m.idPersonalAlmacen,

                BackgroundItem = (m.estado == 0) ? (Color)App.Current.Resources["AlertLight"] : Color.Transparent,
                TextColorItem = (m.estado == 0) ? (Color)App.Current.Resources["Alert"] : (Color)App.Current.Resources["GreyDark"],
            }));
        }
        public AlmacenListRpt GetListReport(AlmacenList list)
        {
            if (list.Count == 0)
            {
                return(null);
            }

            AlmacenListRpt doc = new ClienteListRpt();

            List <AlmacenPrint> pList = new List <AlmacenPrint>();

            foreach (AlmacenInfo item in list)
            {
                pList.Add(AlmacenPrint.New(item));;
            }

            doc.SetDataSource(pList);
            doc.SetParameterValue("Empresa", Schema.Name);

            return(doc);
        }