Beispiel #1
0
        private void ValoresPorDefecto()
        {
            iNumeroitem.EditValue = VwNotacreditoclidet.Numeroitem;

            ////Centro de costo por defecto
            if (VwAreaList != null && VwAreaList.Count == 1)
            {
                VwArea vwAreaPorDefecto = VwAreaList.FirstOrDefault();
                if (vwAreaPorDefecto != null)
                {
                    iIdarea.EditValue = vwAreaPorDefecto.Idarea;
                }
            }

            ////Centro de costo por defecto
            if (VwCentrodecostoList != null && VwCentrodecostoList.Count == 1)
            {
                VwCentrodecosto vwCentrodecostoPorDefecto = VwCentrodecostoList.FirstOrDefault();
                if (vwCentrodecostoPorDefecto != null)
                {
                    iIdcentrodecosto.EditValue = vwCentrodecostoPorDefecto.Idcentrodecosto;
                }
            }

            ////Centro de costo por defecto
            if (VwProyectoList != null && VwProyectoList.Count == 1)
            {
                VwProyecto vwProyectoList = VwProyectoList.FirstOrDefault();
                if (vwProyectoList != null)
                {
                    iIdproyecto.EditValue = vwProyectoList.Idproyecto;
                }
            }
        }
Beispiel #2
0
        private void iIdproyecto_AddNewValue(object sender, AddNewValueEventArgs e)
        {
            var proyectoMntFrm = new ProyectoMntFrm(0, TipoMantenimiento.Nuevo, null, null);

            proyectoMntFrm.ShowDialog();
            if (proyectoMntFrm.IdEntidadMnt > 0)
            {
                VwProyecto vwProyecto = Service.GetVwProyecto(proyectoMntFrm.IdEntidadMnt);
                if (vwProyecto != null && vwProyecto.Idproyecto > 0)
                {
                    VwProyectoList.Add(vwProyecto);
                    e.Cancel   = false;
                    e.NewValue = vwProyecto.Idproyecto;
                }
            }
        }
Beispiel #3
0
        private void iIdproyecto_EditValueChanged(object sender, EventArgs e)
        {
            var idProyectoSel = iIdproyecto.EditValue;

            if (idProyectoSel != null)
            {
                VwProyecto vwProyectoSel = VwProyectoList.FirstOrDefault(x => x.Idproyecto == (int)idProyectoSel);
                if (vwProyectoSel != null)
                {
                    rCodigoproyecto.EditValue = vwProyectoSel.Codigoproyecto;
                    rNombreempresa.EditValue  = vwProyectoSel.Nombreempresa;
                }
            }
            else
            {
                rCodigoproyecto.EditValue = string.Empty;
                rNombreempresa.EditValue  = string.Empty;
            }
        }
Beispiel #4
0
        private void ValoresPorDefecto()
        {
            iNumeroitem.EditValue = VwordenserviciodetMnt.Numeroitem;

            ////Area por defecto
            if (VwAreaList != null && VwAreaList.Count == 1)
            {
                VwArea vwAreaPorDefecto = VwAreaList.FirstOrDefault();
                if (vwAreaPorDefecto != null)
                {
                    iIdarea.EditValue = vwAreaPorDefecto.Idarea;
                }
            }

            ////Centro de costo por defecto
            if (CentrodecostoList != null && CentrodecostoList.Count == 1)
            {
                Centrodecosto centrodecostoPorDefecto = CentrodecostoList.FirstOrDefault();
                if (centrodecostoPorDefecto != null)
                {
                    iIdcentrodecosto.EditValue = centrodecostoPorDefecto.Idcentrodecosto;
                }
            }

            ////Centro de costo por defecto
            if (VwProyectoList != null && VwProyectoList.Count == 1)
            {
                VwProyecto vwProyectoList = VwProyectoList.FirstOrDefault();
                if (vwProyectoList != null)
                {
                    iIdproyecto.EditValue = vwProyectoList.Idproyecto;
                }
            }

            Ordencompradet ordencompradet = Service.UltimoRegistroOrdenCompraDet();

            if (ordencompradet != null)
            {
                iIdarea.EditValue = ordencompradet.Idarea;
            }
        }