Example #1
0
        private void ActualizarDatos()
        {
            WrapperManager         manager    = new WrapperManager();
            List <CorredorWrapper> corredores = manager.GetAllCorredorWrapper();

            gcDxCorredores.DataSource = corredores;
        }
 /// <summary>
 ///     Registers the wrappers using <see cref="T:MugenMvvmToolkit.Infrastructure.WrapperManager" /> class.
 /// </summary>
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper<IWrapper, WrapperWindowViewModel>(
         (type, context) => context.Contains(Constants.WindowPreferably));
     wrapperManager.AddWrapper<IWrapper, WrapperPageViewModel>(
         (model, context) => context.Contains(Constants.PagePreferably));
 }
        public FormIniciarCarrera()
        {
            InitializeComponent();
            WrapperManager nuevoWrapperManager = new WrapperManager();

            sglueDxCategoria.Properties.DataSource = nuevoWrapperManager.GetAllCategoriaWrapperNoIniciado();
        }
        public static dynamic GetAutoQuery <TEntity>(string queryString, Type entityType, IQueryable <TEntity> query, AutoQueryableProfile profile) where TEntity : class
        {
            if (string.IsNullOrEmpty(queryString))
            {
                IEnumerable <string> columns = SelectHelper.GetSelectableColumns(profile?.UnselectableProperties, entityType);
                return(query.Select(SelectHelper.GetSelector <TEntity>(string.Join(",", columns.ToArray()))));
            }
            string[] queryStringParts = queryString.Replace("?", "").Split('&');

            IList <Criteria> criterias = CriteriaManager.GetCriterias(entityType, queryStringParts).ToList();
            IList <Clause>   clauses   = ClauseManager.GetClauses(queryStringParts).ToList();

            Clause wrapWithClause = clauses.FirstOrDefault(c => c.ClauseType == ClauseType.WrapWith);
            var    countAllRows   = false;
            IEnumerable <WrapperPartType> wrapperParts = null;

            if (wrapWithClause != null)
            {
                wrapperParts = WrapperManager.GetWrapperParts(wrapWithClause.Value.Split(',')).ToList();
                countAllRows = wrapperParts.Contains(WrapperPartType.TotalCount);
            }

            QueryResult queryResult = QueryBuilder.Build(query, entityType, clauses, criterias, profile?.UnselectableProperties, countAllRows);

            if (wrapWithClause == null)
            {
                return(queryResult.Result);
            }

            return(WrapperManager.GetWrappedResult(wrapperParts, queryResult, clauses, queryString));
        }
        public void ActualizarDatos()
        {
            WrapperManager nuevoWrapperManager = new WrapperManager();
            List <CorredorTiempoReporte> tiempoWrapperLista =
                nuevoWrapperManager.GetAllCorredorTiempoReporteWrapper();

            gcDxTiempo.DataSource = tiempoWrapperLista;
        }
Example #6
0
        public FormConsultaCorredor()
        {
            InitializeComponent();
            WrapperManager         manager    = new WrapperManager();
            List <CorredorWrapper> corredores = manager.GetAllCorredorWrapper();

            gcDxCorredores.DataSource = corredores;
        }
Example #7
0
        private void ActualizarDatos()
        {
            WrapperManager       nuevoWrapperManager = new WrapperManager();
            List <TiempoWrapper> tiempoWrapperLista  =
                nuevoWrapperManager.GetAllTiempoWrapper();

            gcDxTiempo.DataSource = tiempoWrapperLista;
        }
Example #8
0
        private void ActualizaDatosCategoria()
        {
            WrapperManager nuevoWrapperManager = new WrapperManager();
            List <CarreraIniciadaWrapper> tiempoWrapperLista =
                nuevoWrapperManager.GetAllCarreraIniciadaWrapper();

            gcDxCarreasIniciadas.DataSource = tiempoWrapperLista;
        }
Example #9
0
 protected override void OnInit()
 {
     base.OnInit();
     ThreadManager.ImmediateInvokeOnUiThread      = true;
     ThreadManager.ImmediateInvokeAsync           = true;
     ThreadManager.ImmediateInvokeOnUiThreadAsync = true;
     _wrapperManager = new WrapperManager(ViewModelProvider);
 }
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper <IWindowView, ContentDialogWrapper>(IsContentDialog,
                                                                   (o, context) => new ContentDialogWrapper((FrameworkElement)o));
     wrapperManager.AddWrapper <IWindowView, SettingsFlyoutWrapper>(
         (type, context) => typeof(SettingsFlyout).IsAssignableFrom(type),
         (o, context) => new SettingsFlyoutWrapper((SettingsFlyout)o));
     wrapperManager.AddWrapper <IWindowView, PopupWrapper>(
         (type, context) => typeof(IPopupView).IsAssignableFrom(type),
         (o, context) => new PopupWrapper((IPopupView)o));
 }
Example #11
0
    protected override void Initialize(RequestContext rc)
    {
        // the PageConfiguration is determined by the
        // Controller that is being called
        var pageName = rc.RouteData.Values.Values.FirstOrDefault();

        this.PageConfiguration = GetPageConfiguration(pageName.ToString());

        WrapperManager wm = GetWrapperManager(this.PageConfiguration.Id);

        ViewData["WrapperTop"]    = wm.WrapperPartOne;
        ViewData["WrapperBottom"] = wm.WrapperPartTwo;

        base.Initialize(rc);
    }
Example #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            lbMensajeError.Text = "";
            String numeroCorredor  = txtEditNumero.Text;
            int    numeroResultado = -1;
            bool   esNumero        = Int32.TryParse(numeroCorredor, out numeroResultado);

            if (esNumero && numeroResultado != -1)
            {
                WrapperManager wrapperManager = new WrapperManager();
                if (wrapperManager.GetBuscaCorredorById(numeroResultado) >= 0)
                {
                    int?carreraID = (int?)SessionData.Instance["carrera_actual_id"];

                    CorredorManager corredorManager      = new CorredorManager();
                    corredor        corredorSeleccionado = corredorManager.GetCorredorById(numeroResultado);
                    if (wrapperManager.GetBuscaCarreraIniciada(corredorSeleccionado.categoria_id) > 0)
                    {
                        TiempoManager managerTiempo = new TiempoManager();
                        managerTiempo.RegistrarTiempo(corredorSeleccionado, carreraID.Value);
                        txtEditNumero.Text = "";
                    }
                    else
                    {
                        lbMensajeError.Text = String.Format("Error la carrera de este corredor aún no ha iniciado", numeroResultado);
                    }
                }
                else
                {
                    tiempo_alterno nuevo = new tiempo_alterno()
                    {
                        numero_corredor = numeroResultado,
                        tiempo_corredor = DateTime.Now
                    };
                    TiempoAlternoManager n = new TiempoAlternoManager();
                    n.Save(nuevo);
                    lbMensajeError.Text = String.Format("Error no se encontro corredor {0} y se guardo en la tabla alterna", numeroResultado);
                    txtEditNumero.Text  = "";
                }
            }
            else
            {
                lbMensajeError.Text = "Por favor ingrese un número valido";
            }
        }
        public FormCrearEditarCorredor()
        {
            InitializeComponent();

            //Ejemplo de como llenar los combo
            dtFecha.DateTime = DateTime.Today;
            WrapperManager nuevoWrapperManager = new WrapperManager();

            sglueDxCategoria.Properties.DataSource = nuevoWrapperManager.GetAllCategoriaWrapper();
            sglueDxClub.Properties.DataSource      = nuevoWrapperManager.GetAllClubWrapper();
            //Obtener objeto con el manager de corredor y llenar los campos del formulario
            //SessionData.Instance["corredo_id_editar];

            if (SessionData.Instance["corredor_id_editar"] != null)
            {
                LlenarFormulario();
            }
        }
Example #14
0
        private static void Main(string[] _args)
        {
            DirectoryInfo dataFolder = new DirectoryInfo(@"..\..\..\Data");

            if (!dataFolder.Exists)
            {
                ConsoleUtility.WriteErrorLine("Folder {0} is not exist", dataFolder.FullName);
                return;
            }

            while (true)
            {
                PrintInfo(dataFolder);

                ConsoleKeyInfo key = Console.ReadKey();
                Console.WriteLine();

                if (key.Key == ConsoleKey.Escape)
                {
                    break;
                }
                else if (key.Key == ConsoleKey.D1)
                {
                    // будет невалидным
                    mCompoundManager = null;

                    ProcessStartInfo info = new ProcessStartInfo();
                    info.FileName         = "doxygen.exe";
                    info.WorkingDirectory = @"..\..\..\doxygen";

                    Process doxygen = Process.Start(info);
                    doxygen.WaitForExit();
                }
                else if (key.Key == ConsoleKey.D2)
                {
                    CheckCompoundManager();

                    string fileName = "CompoundTree.xml";
                    mCompoundManager.DumpCompoundTree(fileName);

                    ConsoleUtility.WriteLine("Dump saved to {0}", fileName);
                }
                else
                {
                    int    offset   = (int)key.Key - (int)ConsoleKey.D3;
                    string fileName = GetFileByOffset(offset, dataFolder);
                    if (fileName != "")
                    {
                        CheckCompoundManager();

                        ConsoleUtility.WriteLine("Generate for {0}", fileName);

                        WrapperManager wrapperManager = new WrapperManager();
                        string         file           = Path.Combine(dataFolder.FullName, fileName);
                        wrapperManager.Initialise(file);

                        ConsoleUtility.WriteLine("Generate complite");
                    }
                    else
                    {
                        ConsoleUtility.WriteErrorLine("Error file found");
                    }
                }

                Console.WriteLine();
            }
        }
 /// <summary>
 ///     Registers the wrappers using <see cref="WrapperManager" /> class.
 /// </summary>
 protected abstract void RegisterWrappers(WrapperManager wrapperManager);
 /// <summary>
 ///     Registers the wrappers using <see cref="WrapperManager" /> class.
 /// </summary>
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper<IWindowView, ContentDialogWrapper>(IsContentDialog,
         (o, context) => new ContentDialogWrapper((FrameworkElement)o));
     wrapperManager.AddWrapper<IWindowView, SettingsFlyoutWrapper>(
         (type, context) => typeof(SettingsFlyout).IsAssignableFrom(type),
         (o, context) => new SettingsFlyoutWrapper((SettingsFlyout)o));
     wrapperManager.AddWrapper<IWindowView, PopupWrapper>(
         (type, context) => typeof(IPopupView).IsAssignableFrom(type),
         (o, context) => new PopupWrapper((IPopupView)o));
 }
Example #17
0
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper <IWindowView, FormViewWrapper>(
         (type, context) => typeof(Form).IsAssignableFrom(type),
         (wrapper, context) => new FormViewWrapper((Form)wrapper));
 }
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper<IEditorWrapperViewModel>(typeof (EditorWrapperViewModel<>));
 }
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper<IWindowView, FormViewWrapper>(
         (type, context) => typeof(Form).IsAssignableFrom(type),
         (wrapper, context) => new FormViewWrapper((Form)wrapper));
 }
Example #20
0
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper <IWindowView, WindowViewWrapper>(
         (type, context) => typeof(Window).IsAssignableFrom(type),
         (o, context) => new WindowViewWrapper((Window)o));
 }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            errPrValidar.Clear();

            //Validar el sexo
            if (rbMasculino.Checked != true && rbFemenino.Checked != true)
            {
                errPrValidar.SetError(gbSexo, "Elemento requerido");
                this.DialogResult = DialogResult.None;
                return;
            }
            //
            //Validar apellido paterno
            if (String.IsNullOrEmpty(txtPaterno.Text))
            {
                errPrValidar.SetError(txtPaterno, "Elemento requerido");
                txtPaterno.Focus();
                this.DialogResult = DialogResult.None;
                return;
            }
            //Ejemplo de como validar que no este vacio o cualquier validación
            if (String.IsNullOrEmpty(txtNombre.Text))
            {
                errPrValidar.SetError(txtNombre, "Elemento requerido");
                txtNombre.Focus();
                this.DialogResult = DialogResult.None;
                return;
            }
            ////Validar fecha de nacimiento
            //if (dtFechaNacimiento.DateTime == new DateTime())
            //{
            //    errPrValidar.SetError(dtFechaNacimiento, "Elemento requerido");
            //    this.DialogResult = DialogResult.None;
            //    return;
            //}
            //Validar club

            int?clubID = (int?)sglueDxClub.EditValue;

            //if (clubID == null)
            //{
            //    errPrValidar.SetError(sglueDxClub, "Elemento requerido");
            //    this.DialogResult = DialogResult.None;
            //    return;
            //}
            if (clubID == null)
            {
                clubID = 4;
            }
            //Validar categoria

            int?cateogriaID = (int?)sglueDxCategoria.EditValue;

            if (cateogriaID == null)
            {
                errPrValidar.SetError(sglueDxCategoria, "Elemento requerido");
                this.DialogResult = DialogResult.None;
                return;
            }



            //Obtener valor para el sexo
            int sex;

            if (rbMasculino.Checked == true)
            {
                sex = 0;
            }
            else
            {
                sex = 1;
            }



            CorredorManager nuevoCorredor = new CorredorManager();
            corredor        nuevo         = new corredor();

            if (SessionData.Instance["corredor_id_editar"] != null)
            {
                nuevo = nuevoCorredor.GetCorredorByNId((int)SessionData.Instance["corredor_id_editar"]);
            }
            nuevo.club_id          = (int)clubID;
            nuevo.categoria_id     = (int)cateogriaID;
            nuevo.fecha            = dtFechaNacimiento.DateTime;
            nuevo.apellido_paterno = txtPaterno.Text;
            nuevo.apellido_materno = txtMaterno.Text;
            nuevo.nombre           = txtNombre.Text;
            nuevo.fecha_nacimiento = dtFechaNacimiento.DateTime;
            nuevo.correo           = txtCorreo.Text;
            nuevo.telefono         = txtTelefono.Text;
            nuevo.facebook         = txtFacebook.Text;
            nuevo.sexo             = sex;
            int  numero;
            bool esNumero = Int32.TryParse(txtId.Text, out numero);

            if (!esNumero)
            {
            }
            else
            {
                nuevo.numero = numero;
            }


            if (SessionData.Instance["corredor_id_editar"] == null)
            {
                WrapperManager nuevoWrap = new WrapperManager();
                if (nuevoWrap.GetBuscaCorredorById(numero) >= 0)
                {
                    errPrValidar.SetError(txtId, "Número repetido");
                    txtNombre.Focus();
                    this.DialogResult = DialogResult.None;
                    return;
                }

                nuevoCorredor.Save(nuevo);
            }
            else
            {
                nuevoCorredor.Update(nuevo);
            }
            MessageBox.Show("Corredor ingresado exitosamente");
            this.Close();
        }
Example #22
0
 protected abstract void RegisterWrappers(WrapperManager wrapperManager);
 protected override void RegisterWrappers(WrapperManager wrapperManager)
 {
     wrapperManager.AddWrapper<IWindowView, WindowViewWrapper>(
         (type, context) => typeof (ChildWindow).IsAssignableFrom(type),
         (o, context) => new WindowViewWrapper((ChildWindow) o));
 }