コード例 #1
0
        private void DoLogin()
        {
            string username = this.txtUsuario.Text.Trim();
            string password = this.txtPassword.Text.Trim();

            Entities.InterAsisst.Operador oPerador = Entities.InterAsisst.Operador.GetByCredeciales(username, password);

            if (oPerador != null)
            {
                if (oPerador.Activo)
                {
                    this.SessionOperador = oPerador;
                    Classes.SessionHelper.CURRENT_VIEW = Classes.Views.LOGIN_VIEW;
                    this.goView(Classes.Views.AFILIADO_VIEW);
                }
                else
                {
                    // Tratar error de usuario no activo;
                    this.lblLoginError.Text = String.Format(Resource.ERR_LOGIN_NOT_ACTIVE, Resource.LBL_OPERADOR_USUARIO);
                }
            }
            else
            {
                // Tratar error de usuario y contraseña.
                this.lblLoginError.Text = String.Format(Resource.ERR_LOGIN_FAIL, Resource.LBL_OPERADOR_USUARIO, Resource.LBL_OPERADOR_CLAVE);
            }
        }
コード例 #2
0
        protected void gdwOperadores_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Entities.InterAsisst.Operador operador = (Entities.InterAsisst.Operador)e.Item.DataItem;

                e.Item.Cells[(int)ColumnOperadores.ID].Text       = operador.ID.ToString();
                e.Item.Cells[(int)ColumnOperadores.USUARIO].Text  = operador.Usuario;
                e.Item.Cells[(int)ColumnOperadores.NOMBRE].Text   = operador.Nombre;
                e.Item.Cells[(int)ColumnOperadores.APELLIDO].Text = operador.Apellido;
                e.Item.Cells[(int)ColumnOperadores.EMAIL].Text    = operador.Email;
                e.Item.Cells[(int)ColumnOperadores.ACTIVO].Text   = operador.Activo ? Resource.TXT_BOOL_TRUE : Resource.TXT_BOOL_FALSE;
                e.Item.Cells[(int)ColumnOperadores.ADMIN].Text    = operador.Admin ? Resource.TXT_BOOL_TRUE : Resource.TXT_BOOL_FALSE;
                ((LinkButton)e.Item.Cells[(int)ColumnOperadores.MODIFICAR].Controls[0]).CommandArgument = operador.ID.ToString();
            }
        }