コード例 #1
0
    private List <Employee> GetDataTable()
    {
        DataAccessServiceClient client = new DataAccessServiceClient();
        EmployeeDataContract    edc    = client.GetEmployeeData(0);

        return(edc.Employees);
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataAccessServiceClient client = new DataAccessServiceClient();

        RadGrid1.DataSource = client.GetEmployeeData(9).Employees;
        RadGrid1.DataBind();
    }
コード例 #3
0
        private DataAccessServiceClient GetDataServiceClient()
        {
            var dataAccessServiceClient = new DataAccessServiceClient();

            dataAccessServiceClient.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["DataServiceUsername"];
            dataAccessServiceClient.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["DataServicePassword"];
            return(dataAccessServiceClient);
        }
コード例 #4
0
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataAccessServiceClient client = new DataAccessServiceClient();

        dt = client.GetEmployeeDataTable().Tables[0];

        (sender as RadGrid).DataSource = dt;
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataAccessServiceClient dsc = new DataAccessServiceClient();

            dt = dsc.GetEmployeeDataTable().Tables[0];
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
コード例 #6
0
        protected void SelectedNewIndex(object sender, EventArgs e)
        {
            DataAccessServiceClient cl  = new DataAccessServiceClient();
            EmployeeDataContract    edc = cl.GetEmployeeData(0);

            DropDownListOutput.DataTextField  = "Job";
            DropDownListOutput.DataValueField = "Id";
            DropDownListOutput.DataSource     = edc.Employees.ToList();
            DropDownListOutput.DataBind();
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataAccessServiceClient cl  = new DataAccessServiceClient();
            EmployeeDataContract    edc = cl.GetEmployeeData(0);

            DropDownListSql.DataTextField  = "Name";
            DropDownListSql.DataValueField = "Id";
            DropDownListSql.DataSource     = edc.Employees.ToList();
            DropDownListSql.DataBind();
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataAccessServiceClient client = new DataAccessServiceClient();
            EmployeeDataContract    edc    = client.GetEmployeeData(0);

            if (!IsPostBack)
            {
                GridView1.DataSource = edc.Employees.ToList();
                GridView1.DataBind();
                UG.Focus();
            }
        }
コード例 #9
0
        /*
         *
         * BOTON REGISTRAR
         *
         */

        private void btnRegistrarte_Click(object sender, RoutedEventArgs e)
        {
            String  username               = txtUsuarioRW.Text;
            String  correo                 = txtCorreoRW.Text;
            String  contrasenia            = pswContrasenia.Password;
            String  codigoInt              = "x";
            Boolean endDO                  = false;
            DataAccessServiceClient client = new DataAccessServiceClient();

            if (validar())
            {
                Correo mail = new Correo();
                (var mensaje, var codigo) = mail.EnviarCorreo(correo);
                do
                {
                    CuadroDialogo dialogo = new CuadroDialogo();
                    if (dialogo.ShowDialog() == dialogo.DialogResult)
                    {
                        codigoInt = dialogo.CodigoIntroducido;
                        if (dialogo.btnCancelar.IsPressed)
                        {
                            endDO = true;
                        }
                    }
                    try {
                        if (codigoInt.Equals(codigo))
                        {
                            int resultado = client.RegistrarJugador(username, correo, contrasenia);
                            if (resultado == 1)
                            {
                                //MessageBoxResult result = MessageBox.Show("Registro exitoso", "Mensaje", MessageBoxButton.OK);
                                // switch (result) {
                                //   case MessageBoxResult.OK:
                                Console.Out.WriteLine("Registrado");
                                this.NavigationService.Navigate(new IniciarSesionPG());
                                //     break;
                                // }
                                endDO = true;
                            }
                        }
                        else
                        {
                            MessageBox.Show("Código erroneo", "Mensaje");
                        }
                    } catch (NullReferenceException ex) {
                    }
                } while (!endDO);
            }
        }
コード例 #10
0
        private Boolean Existe(String username, String correo)
        {
            Boolean respuesta = false;

            try {
                DataAccessServiceClient client = new DataAccessServiceClient();
                if (client.Existe(username, correo))   //Validacion de conexión
                {
                    MessageBox.Show("Correo y/o Username existente", "Mensaje");
                    ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Tiempo de espera agotado");
                    respuesta = true;
                }
            } catch (System.TimeoutException ex) {
                ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Tiempo de espera agotado");
            } catch (System.ServiceModel.EndpointNotFoundException ex) {
                ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Error de conexión");
            }
            return(respuesta);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataAccessServiceClient dsc = new DataAccessServiceClient();

            dt = dsc.GetEmployeeDataTable().Tables[0];
            if (!IsPostBack)
            {
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }

            if (IsPostBack && FileUpload1.PostedFile != null && FileUpload1.HasFile)
            {
                if (FileUpload1.PostedFile.FileName.Length > 0)
                {
                    FileUpload1.SaveAs(Server.MapPath("~/WorkingDir/Uploads/" + FileUpload1.FileName));
                }
            }
        }
コード例 #12
0
        private void InitialiseDropDownlist(List <dynamic> temp)
        {
            #region From XML
            CountriesDropDownlist.DataSource     = (temp).ToList();
            CountriesDropDownlist.DataTextField  = "Text";
            CountriesDropDownlist.DataValueField = "Value";

            CountriesDropDownlist.DataBind();
            #endregion

            #region From SQL
            DataAccessServiceClient cl  = new DataAccessServiceClient();
            EmployeeDataContract    edc = cl.GetEmployeeData(0);

            DropDownListSql.DataTextField  = "Name";
            DropDownListSql.DataValueField = "Id";
            DropDownListSql.DataSource     = edc.Employees.ToList();
            DropDownListSql.DataBind();
            #endregion
        }
コード例 #13
0
        private void BtnIniciarSesion_Click(object sender, RoutedEventArgs e)
        {
            DataAccessServiceClient client = new DataAccessServiceClient();

            if (CamposLlenos())
            {
                try {
                    if (client.Autenticar(txtUsuario.Text, txtContrasenia.Password))
                    {
                        JugadorSingleton jugador       = JugadorSingleton.GetJugador(client.GetJugador(txtUsuario.Text, txtContrasenia.Password));
                        Inicio           ventanaInicio = new Inicio();
                        ventanaInicio.Show();
                        Window.GetWindow(this).Close();
                        client.Close();
                    }
                    else
                    {
                        ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Usuario y/o contraseña incorrecta");
                    }
                } catch (System.ServiceModel.EndpointNotFoundException ex) {
                    ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Error de conexión");
                } catch (System.TimeoutException ex) {
                    ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Tiempo de espera agotado");
                } catch (System.ServiceModel.CommunicationException ex) {
                    ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Tiempo de espera agotado");
                }
            }
            else
            {
                ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("Alerta", "Campos incompletos");
            }

            //BORRAR

            /*Inicio ventanaInicio = new Inicio();
             * ventanaInicio.Show();
             * Window.GetWindow(this).Close();*/
        }