Esempio n. 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;
                }
            }
        }
Esempio n. 2
0
        private void iIdcentrocosto_AddNewValue(object sender, AddNewValueEventArgs e)
        {
            CentrodecostoMntFrm centrodecostoMntFrm = new CentrodecostoMntFrm(0, TipoMantenimiento.Nuevo, null, null);

            centrodecostoMntFrm.ShowDialog();
            if (centrodecostoMntFrm.IdEntidadMnt > 0)
            {
                VwCentrodecosto vwCentrodecosto = Service.GetVwCentrodecosto(x => x.Idcentrodecosto == centrodecostoMntFrm.IdEntidadMnt);
                if (vwCentrodecosto != null)
                {
                    VwCentrodecostoList.Add(vwCentrodecosto);
                    e.Cancel   = false;
                    e.NewValue = vwCentrodecosto.Idcentrodecosto;
                }
            }
        }